Skip to content

Migrating edX containers from one server to another

Filip Jukić edited this page Jan 15, 2015 · 5 revisions

1. Making backups

  1. SSH into your old docker server: ssh root@<old_server_ip>
  2. Download the backup script: curl -O https://raw.githubusercontent.com/appsembler/configuration/docker_release/backup_scripts/backup_edx.sh && chmod +x backup_edx.sh
  3. Download the SSH key for SSHing into the container: curl -o insecure_key -fSL https://github.com/phusion/baseimage-docker/raw/master/image/insecure_key && chmod 600 insecure_key
  4. Run the backup script with the container ID or name as a parameter: backup_edx.sh <container_id>
  5. Temporarily add the insecure public key to your authorized_keys SSH file: curl https://raw.githubusercontent.com/phusion/baseimage-docker/master/image/insecure_key.pub >> .ssh/authorized_keys

2. Transfer and restore backups

  1. Launch a new instance of edX on Appsembler Launcher
  2. SSH into your new docker server: ssh root@<new_server_ip>
  3. Download the SSH key: curl -o insecure_key -fSL https://github.com/phusion/baseimage-docker/raw/master/image/insecure_key && chmod 600 insecure_key
  4. Transfer the backups: scp -i insecure_key root@<old_server_ip>:edx_\* .
  5. Download the restore script: curl -O https://raw.githubusercontent.com/appsembler/configuration/docker_release/backup_scripts/restore_edx.sh && chmod +x restore_edx.sh
  6. Run the restore script with the container name (it's in the deployed app URL) as a parameter: restore_edx.sh <container_name> (container name: openedxliteXXXXXX)
  7. (optional) If course assets are missing, after all the above, export the courses in the CMS of the old site and import them in the CMS of the new site.
  8. Delete the insecure key from the old server ssh root@<old_server_ip>, vim .ssh/authorized_keys

3. Change the routing to use the old URL on new container

  1. Find the new deployment in the Launcher admin and copy the field "Remote container ID"
  2. Find the old deployment in the Launcher admin and paste that value in the field "Remote container ID"
  3. Use the (yet nonexistent) refresh routes option for the old container
  4. Delete the new deployment