Restore Failure - S3 (compatible) backup

Thanks @Falco, appreciate it! Worked completely smoothly :smiley:

I migrated to a new server, seems like it would have been fine staying on the same server as well.

In case someone else wants to reference this later, the steps in more detail where (note that my s3 settings were just in the app.yml file as specified here, nothing customised in the admin settings):

  1. On source site, if not a rollback, enable ‘disable emails’ (might not be necessary) and turn on read-only mode (remember to switch these back on the new instance once migration is complete). Create backup, once complete, consider stopping the old instance also (./launcher stop app). Regardless of if a rollback or not, update DNS A records to point to the new server IP. You can do these in a more elegant way or order to minimise downtime, downtime wasn’t a concern for my case (rollback, not launched forum).

  2. Install Discourse on the new server and migrate everything custom in the app.yml over including s3 settings, have the Discourse versions be the same or close to the same.

  3. Comment out these two records (other s3 settings in the app.yml can be left as is):
    DISCOURSE_S3_BACKUP_BUCKET: BucketName
    DISCOURSE_BACKUP_LOCATION: s3

  4. Manually download desired backup from s3 or s3 compatible service.

  5. Navigate to /var/discourse/shared/standalone/backups and create a new folder called ‘default’ if it doesn’t exist (it won’t if it’s a new install). Then, while in the backups directory run (this changes folder permissions to match what this folder would normally have if Discourse created a local backup - not sure if necessary):
    chown -R 1000:www-data default

  6. Upload backup into the backups/default folder using a SFTP client, don’t rename the backup file.

  7. Rebuild app:
    cd /var/discourse
    ./launcher rebuild app

  8. Enter app, enable backups and restore (rename BackupFileName.tar.gz):

./launcher enter app
discourse enable_restore
discourse restore BackupFileName.tar.gz
  1. Once complete, uncomment the two s3 backup file lines in the app.yml from step 2 and rebuild app.

  2. You can delete the local backups/default folder and contained backup (/var/discourse/shared/standalone/backups).

Reference:

4 Likes