I have attempted the manual method of creating and restoring a backup of my Docker based installation, but it is failing me. I’ve tried steps one and two, the first of which I could get to work with a slight modification (
cd /var/discourse instead of
- If your old Discourse…
- lives in a Docker container, enter it:
sudo ./launcher enter app
su - discourse
- does not live in a Docker container, you should at this point ensure that the user you’re logged in as can use pg_sql to connect to Discourse’s production database and has access to the uploaded files. You may also have to adjust the directory and file names below.
- Export the database and uploaded files:
pg_dump -xOf /shared/discourse-backup.sql -d discourse -n public
gzip -9 /shared/discourse-backup.sql
tar -czf /shared/discourse-uploads.tar.gz -C /var/www/discourse/public uploads
I gave up on step two though, since I don’t have the permission to write to /shared/discourse-backup.sql.