nativeInstalleredx

Migrate Open edX

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and Mac OS X) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). Learn more.

NOTE: Before proceeding to migrate the Bitnami edX stack, ensure that you have performed a complete backup.


Migrate edX

Log in to your edX instance and follow the steps below:

  • Create a directory where to store all the data:

    $ mkdir edx-migrate-data
    
  • Dump databases required by edX:

    • MySQL:

      $ installdir/mysql/bin/mysqldump -u root -p --databases bitnami_edxapp bitnami_edxapp_csmh bitnami_xqueue --add-drop-database > edx-migrate-data/bitnami_edx_mysql.sql
      
    • MongoDB:

      $ installdir/mongodb/bin/mongodump --authenticationDatabase admin -u root -p -d bitnami_edxapp --out edx-migrate-data/bitnami_edx_mongodb
      $ installdir/mongodb/bin/mongodump --authenticationDatabase admin -u root -p -d bitnami_cs_comments_service --out edx-migrate-data/bitnami_edx_mongodb
      
  • Copy edX Platform configuration and data files (which contain uploads, courses, etc.):

    $ cp installdir/apps/edx/conf/*.json edx-migrate-data
    $ cp -R installdir/apps/edx/var edx-migrate-data
    
  • Copy edX XQueue configuration files:

    $ cp installdir/apps/edx/conf/*.json edx-migrate-data
    
  • Copy edX Forum configuration files:

    $ cp installdir/apps/forum/conf/httpd-forum.conf edx-migrate-data
    
  • Compress the generated files:

    $ tar czf edx-migrate-data.tar.gz edx-migrate-data
    
  • Copy edx-migrate-data.tar.gz over to the new edX instance.

Next, log in to the new edX instance and navigate to the directory where you copied edx-migrate-data.tar.gz. Then, proceed with the following steps:

  • Extract the compressed file:

    $ tar xzf edx-migrate-data.tar.gz
    
  • Migrate databases:

    • MySQL:

      $ installdir/mysql/bin/mysql -u root -p < edx-migrate-data/bitnami_edx_mysql.sql
      
    • MongoDB:

      $ installdir/mongodb/bin/mongorestore -h localhost --authenticationDatabase admin -u root --drop -d bitnami_edxapp edx-migrate-data/bitnami_edx_mongodb/bitnami_edxapp
      $ installdir/mongodb/bin/mongorestore -h localhost --authenticationDatabase admin -u root --drop -d bitnami_cs_comments_service edx-migrate-data/bitnami_edx_mongodb/bitnami_cs_comments_service
      
  • Migrate edX Platform data:

    • Replace the edX Platform data directory with the one copied from your previous edX installation (note that you need to clear the assets):

      $ sudo rm -rf installdir/apps/edx/var
      $ sudo cp -R edx-migrate-data/var installdir/apps/edx/var
      $ sudo chown -R daemon:daemon installdir/apps/edx/var
      $ sudo rm -rf installdir/apps/edx/var/staticfiles/*
      
    • (Optional) Review edX Platform configuration for custom changes in the previous installation (e.g. themes, SMTP configuration, etc.):

      • LMS configuration files: installdir/apps/edx/conf/lms.auth.json and installdir/apps/edx/conf/lms.env.json.
      • CMS configuration files: installdir/apps/edx/conf/cms.auth.json and installdir/apps/edx/conf/cms.env.json.
    • Run edX Platform migrations:

      $ sudo installdir/apps/edx/bin/edxapp-migrate-lms
      $ sudo installdir/apps/edx/bin/edxapp-migrate-cms
      
    • Update assets for edX Platform:

      $ sudo installdir/apps/edx/bin/edxapp-update-assets-lms
      $ sudo installdir/apps/edx/bin/edxapp-update-assets-cms
      
  • Migrate edX XQueue data:

    • (Optional) Check the edX XQueue configuration file for any changes for customizing your application: installdir/apps/xqueue/conf/xqueue.yml.

      NOTE: Since edX Hawthorn, a couple of major changes have happened: The XQueue configuration files xqueue.auth.json and xqueue.env.json have been merged into xqueue.yml, and it does not use RabbitMQ anymore.

    • Run edX XQueue migrations:

      $ sudo installdir/apps/xqueue/bin/django-admin.xqueue migrate --noinput
      
  • Restart Apache, edX Celery Workers and XQueue:

    $ sudo installdir/ctlscript.sh restart apache
    $ sudo installdir/ctlscript.sh restart edx
    $ sudo installdir/ctlscript.sh restart xqueue
    

Your Bitnami edX stack should now be fully migrated. Confirm that the migration was successful by logging into edX and verifying the integrity of your data.

Last modification December 10, 2018