awsdiscourse

Create and restore application backups

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

Backup

To backup, follow the steps below:

  • Log in to the application as an administrator.

  • Select the “Admin -> Backups” menu item.

  • Click the “Backup” button.

    Discourse backup

It is possible to create a backup with or without uploaded images. Note this process could take some time depending on your database and the size of the uploaded files.

Once the backup has been created, download the backup file and store it in a safe location.

Restore

Restoring a backup in Discourse is disabled by default. To restore, follow the steps below:

  • Log in to the application as an administrator.

  • Enable restoration using the “Settings -> Backups -> Allow restore” menu.

    Discourse restore

  • Select the “Admin -> Backups” menu item.

  • Upload the backup file and restore its contents.

IMPORTANT: Restoring Discourse backups requires the bn_discourse user’s password from the Discourse discourse.conf configuration file. Depending on your installation type, this file can be found in the following locations:

  • Approach A (Bitnami installations using system packages): /opt/bitnami/discourse/config/discourse.conf

  • Approach B (Self-contained Bitnami installations): /opt/bitnami/apps/discourse/htdocs/config/discourse.conf

You can provide this password by running the following command in your terminal window:

export PGPASSWORD=“BN_DISCOURSE_USER_PASSWORD”

Last modification June 16, 2021