Backup discourse from the command line

You need to configure s3 in env variables as described in Configure an S3 compatible object storage provider for uploads

This is especially true if the s3 settings are different on the new server. Putting the s3 values in the database can cause lots of problems.

But there is a switch for the restore command that makes it pause between the various parts. It can help.