From 6daffe8e92a4018bad1b3b5de98edcba6a43dd9c Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Sun, 18 May 2014 15:47:40 +0530 Subject: [PATCH] Update MIGRATION.md --- docs/MIGRATION.md | 128 +++++++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 47 deletions(-) diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index da6327273..e76a22c09 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -1,59 +1,93 @@ -Deploying [Discourse on Docker][1] is currently our recommended setup. It avoids many pitfalls installations have, such as misconfigured nginx, sub-optimal Ruby defaults and so on. +So you want to move your existing Discourse instance to a new server? -The Docker based setup ensures we are all on the same page when diagnosing installation issues and completely eradicates a class of support calls. +In this guide we'll move an existing Discourse instance on [Linode][linode] to a new Discourse instance on [Digital Ocean][do], although these steps will work on other cloud providers that also support Docker. Let's start! -Today, all sites hosted by Discourse are on Docker. +## Log In as Admin on Existing Server -This is a basic guide on how to move your current Discourse setup to a Docker based setup. +Only admins can perform backups, so sign in as an account with admin access on your existing Discourse instance on Linode. -## Getting started + -First, get a blank site with working email installed. Follow the guide at https://github.com/discourse/discourse_docker and install a new, empty Discourse instance. +## Update Existing Install -**Tips:** +Both the new and old Discourses **MUST BE ON THE EXACT SAME VERSION** to ensure proper backup/export. So the first thing we'll do is update our existing Discourse instance on Linode to the absolute latest version. -- Bind the web to a different port than port 80, if you are on the same box. Eg: +Visit `/admin/docker` to upgrade. - expose: - - "81:80" +(If you are running the [deprecated Ubuntu install][dep_ubuntu] you may need to follow [these update instructions][ubuntu_update].) -- Be sure to enter your email in the developer email section, so you get admin: + - env: - # your email here - DISCOURSE_DEVELOPER_EMAILS: 'my_email@email.com' +After successfully upgrading, you should see *You're up to date!* + + + +## Download Your Backup + +Visit `/admin/backups` and click **Backup** button. + + + +You will be prompted for confirmation, press **Yes**. + + + +Once confirmed, you will be able to see the log of backup processing. Once the processing is finished, switch back to **Backups** tab. + + + +Now you will see the newly created backup file. Click **Download** button and save the file, we will need it later for restoration on the new server. + + + +## Log In as Admin on New Server + +Sign up and login on your new Discourse instance at Digital Ocean. + + + +## Enable Restore + +Under site settings search for `restore`: + + + +Enable the `allow_restore` setting, and refresh the page for changes to take effect. + +## Restore Backup + +Browse to `/admin/backups` and click **Upload** button, select the backup file you downloaded previously from your existing Discourse instance (file name ends with `.tar.gz`): + + + +Once the file gets 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 existing Discourse instance (Linode server) data. + + + +Once the Restore process finishes, you will be logged out. + +## Log In and You're Done + +Once the restore process finishes, all the data from your previous Discourse instance on Linode server will be imported in your new Discourse instance on Digital Ocean, sign in with your Admin account and you are good to go! + + + +If anything needs to be improved in this guide, feel free to ask on [meta.discourse.org][meta]. -- Make sure email is setup and working by visiting `/admin/email` and sending a test email. - -- Make sure you have ssh access to your container `./launcher ssh my_container` must work. - -**If any of the above is skipped your migration will fail.** - -At the end of this process you will have a working website. Carry on. - - -## Exporting and importing the old site - -- Ensure you are running the absolute latest version of Discourse. We had bugs in the export code in the past, make sure you are on latest before attempting an export. - -- On your current instance - - go to `/admin/backups` and click on the ![Backup](https://meta-discourse.r.worldssl.net/uploads/default/3418/083f92873b96625c.png) button. - - once the backup is done, you will be able to ![Download](https://meta-discourse.r.worldssl.net/uploads/default/3420/fd77ea7e700101cd.png) it. - -- On your newly installed docker instance - - enable the `allow_restore` site setting - - refresh your browser for the change to be taken into account - - go to `/admin/backups` and ![Upload](https://meta-discourse.r.worldssl.net/uploads/default/3419/21e172a1f1059364.png) your backup. - - once your upload is done, click on the ![Restore](https://meta-discourse.r.worldssl.net/uploads/default/3421/2946f976f3bea2bb.png) button - - -- Destroy old container `./launcher destroy web` - -- Change port binding so its on 80 - -- Start a new container - -Yay. You are done. - - [1]: INSTALL-digital-ocean.md + [do]: https://www.digitalocean.com/?refcode=5fa48ac82415 + [dep_ubuntu]: https://github.com/discourse/discourse/blob/master/docs/INSTALL-ubuntu.md + [ubuntu_update]: https://github.com/discourse/discourse/blob/master/docs/INSTALL-ubuntu.md#updating-discourse + [official_install]: https://github.com/discourse/discourse/blob/master/docs/INSTALL.md + [do_install]: https://github.com/discourse/discourse/blob/master/docs/INSTALL-digital-ocean.md + [linode]: https://www.linode.com/ + [namecheap]: https://www.namecheap.com/ + [meta]: https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721 \ No newline at end of file