openedx-vlead / port-labs-to-openedx

3 stars 8 forks source link

Open edX Backup #15

Closed sivashankerN closed 8 years ago

sivashankerN commented 8 years ago

Descibes how to backup Open edX platform databases. If required, take backup of files uploaded by students or uploaded in Studio by super user to access these files by students

sivashankerN commented 8 years ago
  1. Database level backup
  2. File level backup If these files are backing up along with the databases.
sivashankerN commented 8 years ago
  1. Database level Backup

    Open edX platfom uses two databases

    1. Mysql (LMS)
    2. MogoDB (CMS)
sivashankerN commented 8 years ago

Database level backup This is the way to take backup of edX platform

Take backup of MySql database using following command (LMS)

mysqldump -u root -p --all-databases > ./backup.sql

Take backup of MongoDB database using following command (CMS)

mongodump -o ./mongo-backup

Also documented in https://github.com/vlead/port-labs-to-openedx/blob/develop/src/platform-install-configure/backup.org#taking-backup-of-lms-machine

sivashankerN commented 8 years ago

Restore the databases in the new edx-plaform from the backups taken above. Steps to restore

  1. Launch a new VM, install Open edX-platform and Configure it appropriately. Refer https://github.com/vlead/port-labs-to-openedx/blob/develop/src/platform-install-configure/index.org
  2. Copy the taken backups in above steps into newly created platform.
  3. Run the following commands to restore them

Restore MongoDB database

mongorestore -drop ./mongo-backup

Restore Mysql database

mysql -u root -p < ./backup.sql

Steps are documented in https://github.com/vlead/port-labs-to-openedx/blob/develop/src/platform-install-configure/backup.org#restoring-the-database