Move your Discourse Instance to a Different Server

In this guide we’ll move an existing Discourse instance on Linode (source) to a new Discourse instance on Digital Ocean (destination), but of course these steps will work on any other cloud providers that support Docker.

:bell: If you are using the same domain name and moving servers, you should set the TTL (time to live) on your DNS entry to a very low value in advance of the change. If you are using different domain names, this won’t matter.

Log In and Update

Only admins can perform backups, so sign in as an account with admin access on your source Discourse instance.

Ideally, both the new and old Discourses should be on the same version, to ensure proper backup/export. What you want to avoid is restoring a newer backup on an older version. That won’t work. Visit /admin/upgrade to upgrade the destination instance for sure, both instances if you can.

Create and Download Your Backup

Visit /admin/backups and click Backup button.

You will be prompted for confirmation, press Yes. You will see the log of backup processing. Once processing is finished, switch back to Backups tab.

Now you will see the newly created backup file. Click Download button and save the file.

:bell: Before you switch over to the new server, review your app.yml for any optional settings such as CDN, installed plugins, and HTTPS support between the two Discourse instances. It’s easier to make sure the two instances are identical before you begin restoring the backup.

Log In and Restore Backup

:bulb: Don’t want to deal with the web UI yet? Follow these steps to restore a backup at the command line.

Sign up and login on your destination Discourse instance.

Under /admin/site_settings search for restore and enable the allow restore setting.

Browse to /admin/backups and click Upload button, select the backup file you downloaded previously from your source Discourse instance (filename ends with .tar.gz):

Once the file is uploaded it will be listed as shown below, click Restore button:

Press Yes when prompted for confirmation. You will see restore process log, it may take some time but it’s automagically importing all your source Discourse instance data.

Once the Restore process finishes, you will be logged out.

Log In and You’re Done

:warning: If you are logging in to a backup that was taken with HTTPS, the site setting “force https” will be enabled. You either need to turn that off via the Rails console, or ensure that your restore is also properly running under HTTPS.

Once the restore process finishes, all the data from your source Discourse instance on Linode server will be imported in your destination Discourse instance on Digital Ocean, sign in with your Admin account and you are good to go!

:bell: Don’t forget to enable any optional configuration settings that require editing the app.yml and rebuilding, such as CDN, plugins, and HTTPS support.

48 Likes

i created a forum on Digital Ocean and played a little with it!
Installed some plugins, played with graphic settings and invited some users to try it aswell…

Now i have created a local developer version and imported our old vbullettin forum in it!
if i restore the backup on the digital ocean server will i lose also the old posts, graphic settings and installed plugins?

Assuming your backup includes attachments restoring the backup will bring across site settings, customisations, posts and uploaded assets. Backups basically contain everything configurable from the web UI.

The backup does not include your app.yml - if you have added any plugins or anything else there then you need to specify them in the app.yml on the DO server.

2 Likes

so when you install discourse on new server you will create a new admin account with user name “admin1”. Let us says on old server there is no user called “admin1” but you have admin account with different name.

In this case “admin1” account on new server will get deleted after restore, right?

Why would the admin need a different name of the restore overwrites it?

It’s not a partial restore, it replaces everything.

2 Likes