Skip to content
Acetousk edited this page Sep 5, 2024 · 1 revision

On the server, run the following after you've run the moqui-org-compose.yml with proper credentials and setup: NOTE: Based on this first: https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md then this https://meta.discourse.org/t/restore-a-backup-from-the-command-line/108034

Migration Prerequisites

  1. Go to: https://forum.moqui.org/admin/backups
  2. Put the production database into read only mode
  3. Create a database backup
  4. Download the database backup
  5. Setup the DNS records to point to the new server
  6. Setup the ssl cert

Code Setup

  1. Go to new server.
  2. Ensure that the docker engine and git are installed
  3. Install Discourse
sudo -s
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
chmod 700 containers
  1. Move exsiting app.yml to /var/discourse/containers (See link in message or ask for example) Note: If there is no app.yml, run in /var/discourse with port 80 and 443 open (you may have to stop the moqui compose file temporarily just for building)
./discourse-setup
  1. Configure the app.yml based on: https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247/244
  2. Make sure to set the VIRTUAL_HOST environment variable
  3. Run
/var/discourse/launcher rebuild app --docker-args '--network nginx-proxy'
  1. Ensure that forum.moqui.org is visible and accessible

Migration

  1. On the new server run:
mkdir -p /var/discourse/shared/standalone/backups/default
  1. Put the exact file name and file data of the just recently created database backup into the /var/discourse/shared/standalone/backups/default directory. Example:
rsync -v moqui-forum-2024-06-20-033420-v20240202052058.tar.gz [email protected]:/var/discourse/shared/standalone/backups/default
  1. Restore the Backup on the new server
# Access your destination server and go to the Discourse folder
cd /var/discourse

# Enter the Discourse Docker app container
./launcher enter app

# From inside the Docker container, enable restores via
discourse enable_restore

# Restore the backup file
discourse restore moqui-forum-2024-06-20-033420-v20240202052058.tar.gz 
  1. Exit by running:
# Exit the Discourse Docker app container
exit
  1. Rebuild
cd /var/discourse
./launcher rebuild app --docker-args '--network nginx-proxy'
  1. Ensure that forum.moqui.org points to the new server, has the correct data, and you are able to login
  2. Cleanup the old instance
Clone this wiki locally