Backing up the entire docker folder vs core backup function

Just trying to understand here, the backup files that are created automatically are rather small (9MB) while my /data folder is 128 MB.

I was reading here, and it seems backing it up live at filesystem is bad. I want to know what to expect when restoring the backup from the web interface.

For me, I like to define backups as if my server dies right now, I can go quickly to the last backup with minimal downtime so I can sleep fine.

My usual backup process would be something like this:

  1. Stop the container with docker stop app
  2. Tar the entire /opt/discourse directory
  3. Start the container with docker start app
  4. Upload the backup off-site

That way I know if my server dies right now, all I have to do is boot another ubuntu server, install docker/etc, download backup off-site, extract data, run ./launcher rebuild app and I’m back online.

The only downside I see is that there is no way that I know of to keep the server up while this happens, but this process can easily be automated.

Is this overkill? Is it really necessary to stop the container? Is there a way to keep forum up, while doing this? Something similar to nextcloud maintenance mode

Thank you!

You should really use the included backup functionality, which will grab a consistent dump of the database with no downtime and only minimal read-only time.
Of course, it is a good idea to have off-site backups: Just regularly backing up the contents of Discourse’s backup directory to an off-site location is enough for this :slight_smile:


I just don’t know if I can feel at rest enough.

Is it really enough to restore the forum as it was? With all the posts, images, history/ etc?

You’ll also need the file containers/app.yml, but that can be re-created rather easily unless you’ve done a lot of customization there. (That file contains the answers you gave to discourse-setup). That file, plus a backup, is enough to restore from scratch: You simply put back app.yml and rebuild to get a blank Discourse instance, register and log in, enable restoring, upload your backup, hit the Restore button and sit back for a minute.
By default, the backup contains both the database and uploads :slight_smile: