Discourse is open source software for community discussion. An example would be if you wanted to add a place for community discussion for a company. Many well-known companies use Discourse for their community, such as Atlassian, Figma, Asana, New Relic, and Cloudflare.
Discourse is designed for a well-performant community hosting open source software, and it includes many plugins which can be enabled in your community on your site. Discourse software runs in a Docker container and uses Redis for performance as an in-memory data store. This article covers migrating a Discourse site to a new virtual private server (VPS).
- VPS on which to run Discourse.
- SSH access for your VPS.
- Admin access on your existing Discourse site.
- Basic command line skills.
- Ability to use the Command line on your VPS.
- Ability to edit DNS entries for your Discourse sub-domain.
Migrate Discourse Site to a New Server
Discourse will need to be installed on your VPS plan to migrate your existing DIscourse install. Discourse is a 100% command line install and has a small amount of setup, which is available from the user interface (UI) of the application.
Find your SSH credentials for your VPS plan to login to your server and install the Discourse site.
During the installation, you will need to know the following information for the Discourse configuration.
Hostname for your Discourse? [discourse.example.com]: Email address for admin account(s)? [firstname.lastname@example.org,email@example.com]: SMTP server address? [smtp.example.com]: SMTP port? : SMTP user name? [firstname.lastname@example.org]: SMTP password? [pa$$word]: Let's Encrypt account email? (ENTER to skip) [email@example.com]: Optional Maxmind License key () [xxxxxxxxxxxxxxxx]:
Put your existing live Discourse site into read-only mode, meaning new content and users will not add to the site's database while the migration is underway.
Navigate to Admin > Backups and click Enable Read-Only.
Now that your Discourse site is in read-only mode, you can create a site backup from the same section. Once the backup is complete, you will need to download the backup locally for importing into your new install Discourse site.
To access the DIscourse new installation when it is complete, you must update the host DNS A record to the new server IP address. How your DNS is updated depends on whose nameservers you use for DNS. If you use Liquid Web’s nameservers, editing the DNS record should be very straightforward. Existing customers can always reach out to the support team for assistance.
Setting the DNS propagation time as short as possible would be recommended to minimize the downtime and total migration time. After the Discourse installation is complete, you can create a new admin user and log in. Confirm the email for the admin user and complete the setup within the browser of the site.
It is recommended to update the DIscourse installation to the latest version.
cd /var/discourse git pull ./launcher rebuild app
After logging into the site, you will need to import the existing site’s backup from the application UI. To upload the backup, enable the restore in the admin panel. Navigate to Admin > Settings > Backups and click the checkbox next to allow restore.
Then, navigate to Admin > Backup > Upload to proceed with the upload. The upload time will depend on your internet connection speed and the backup file size. A rough estimate of migration time for a planned Discourse site maintenance might be between 30 and 60 minutes.
Informing your Discourse community well before the site migration makes it less of a surprise when it goes into read-only mode, keeping them informed and aware. You could add an announcement post about the expected scheduled maintenance time to your existing Discourse site and post it on social media for your community to see. You can also create an email communication if your community has email marketing.
If your existing Discourse site uses plugins, you need to copy them from app.yml for the existing site and add them into the app.yml file for the new installation. Once completed, update Discourse from the command line.
It is recommended to have a local backup of your app.yml file for your Discourse site so that you can update and rebuild the app as needed. Copying the plugin entries from your local file into the one used on the new installation can be done locally and offline. If you do it this way, replace the app.yml file using your file manager application, or you can edit the server file and then save it with the following command.
cd /var/discourse ./launcher rebuild app
After correctly importing the backup, check that the settings are correct in the admin section of your Discourse site. You do not have to change the subdomain of your Discourse site, and it can stay the same as before.
Installation of a new Discourse site and migrating an existing Discourse site is not as complex as it might seem. The longest part of the process is installing the new Discourse install on your VPS plan and the DNS updating process. If you prepare and plan, the complete process can be accomplished within an hour, but your mileage may vary.
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.