Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to restore Ghostwriter's database #590

Open
b34c0n5 opened this issue Feb 27, 2025 · 3 comments
Open

Unable to restore Ghostwriter's database #590

b34c0n5 opened this issue Feb 27, 2025 · 3 comments

Comments

@b34c0n5
Copy link

b34c0n5 commented Feb 27, 2025

Upon transfering the Gunzipped backup.sql and issuing the restore command along it, I keep receiiving an error regarding no backup file was found, even if the file is in the directory from which the command is used (inside a Dockerized terminal)

Originally posted by @b34c0n5 in #145

@chrismaddalena
Copy link
Collaborator

Hey @b34c0n5, how are you transferring the file?

When you run ./ghostwriter-cli backup, the script creates a backup file in a dedicated volume for the PostgreSQL container. The restore command takes the name of the backup file you want to restore. As long as that file exists in the volume, it should restore.

You can run ./ghostwriter-cli backup --list to see the files available.

@b34c0n5
Copy link
Author

b34c0n5 commented Mar 5, 2025

Do you know if I could further transfer the respective dedicated backup volume to another Ghostwriter instance, and restore from it using the latter instance?

@chrismaddalena
Copy link
Collaborator

You can do that. The easiest way to do this is with something like Docker Desktop or OrbStack, which lets you open the volumes and move the files. Otherwise, you can use Docker commands.

  1. Copy your backup file(s) off the ghostwriter_production_postgres_data_backups volume.
  2. Move the file(s) to the new instance's ghostwriter_production_postgres_data_backups volume.
  3. Restore the backup.

If you're trying to move everything, you'll also need to migrate the media files (e.g., user profile pictures, templates, evidence files) referenced in the database.

docker cp --archive ghostwriter-django-1:/app/ghostwriter/media ~/Desktop

That will copy all your media from the volume while also preserving permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants