This guide provides step-by-step instructions for creating, downloading, and restoring a backup of your Discourse database.
Required user level: Administrator
Discourse allows site administrators to create and download a copy of the site’s database. The backup can then be uploaded and restored to any Discourse forum.
Discourse backups include the full site database, which contains everything on the site: topics, posts, users, groups, settings, themes, etc. Depending on how the backup file is created, it may or may not include uploads. See the next section for details.
Though the data created by plugins exist in the database, the plugins themselves are installed in your app.yml
file. To restore your site to a new server you will need to make sure that your installation includes the plugins you require.
Create a backup
To create a backup of your Discourse site, follow these steps:
- Go to the Admin / Backups section of your site.
- Click the Backup button.
- A modal window will open asking you whether or not you would like to include the site’s uploads in the backup. Specify whether you want to include site uploads in your backup.
If your site is hosted by us and you would like to create a backup that includes uploads, contact the Discourse team before creating the backup.
- Initiate the backup by selecting your preferred option.
Download a backup
When the backup is complete, Discourse will send you a notification.
- Click the link in the notification to return to your Backups page. Then click the Download button.
- An email with a link to download the backup will be sent to you. Click the link to save the backup to your computer.
Upload a backup
- To upload a backup, go to the Admin / Backups section of your site and click the Upload button.
- This will open your browser’s file manager. Select the backup from your file system and click the file manager’s Open button. The new backup file will be displayed in the file list.
Restore a backup
Before you are able to restore your backup file you need to enable the allow restore
site setting. Then click the Restore button on the Backups page for the backup you want to restore.
Restoring a backup file will overwrite all data on the site. When the backup is restored, you will be logged out of the site and need to log back in with your credentials from the restored site.
Make sure the site you are restoring into is running the same version of Discourse as the old site. It is best to update both sites to the latest version before running the backup/restore process.
The restore process automatically sets the disable emails
setting to “non-staff”, so emails aren’t sent to your site’s users until you’re ready.
If your site is hosted by Discourse, the Restore button in the screenshot below will be disabled. After uploading the backup file, contact the Discourse team and let us know the name of the backup file that you wish to restore. We will restore it for you.
Command line backup and restore
For administrators comfortable with the command line, you can create and manage backups programmatically:
- Backups are stored in
/var/discourse/shared/standalone/backups
. - Start a backup using:
./launcher run app discourse backup
or
docker exec app bash -c "discourse backup"
For more information about command line backups, see: Backup discourse from the command line.
Last edited by @SaraDev 2024-08-23T20:11:51Z
Check document
Perform check on document: