How do I restore backed up data and files to my MangoApps on-premise domain?

  1. Restoring the MangoApps DB from Backup - All MangoApps database dumps are full database dumps. It is easy to restore your MangoApps database. Please follow the steps below to restore your database from a full backup. For the purpose of this article, let’s assume name of the database dump is mangoapps-

    1. cp mangoapps- mangoapps-

    2. gunzip mangoapps-

    3. If the name of the domain is changing, then use sed tool to replace all instances of that domain name in the sqldump file with the new domain name. e.g.

      1. sed ‘s/<old FQDN>/<new FQDN>/g’ mangoapps- > mangoapps-

    4. mysql -u[mysqlusername] -p[mysqlpassword] -h[mysqlhost] sg_public < mangoapps- (or mangoapps- if you ran the sed tool to replace the domain name in step 3-1).

    You can get the mysqlusername, mysqlhost and mysqlpassword of the MangoApps user from your MangoApps application server at path location: /var/www/sg/config/database.yml

  2. Migrating the DB to a new MangoApps Instance - To migrate data to a new MySQL instance, please follow these 3 steps:

    1. Create MangoApps database

      • create database sg_public;

    2. Once you have MySQL installed, create a MySQL user for MangoApps (same as what is configured in /var/www/sg/config/database.yml)

      • GRANT ALL ON sg_public.* TO [mysqlusername]@`%` identified by '['mysqlpassword]';

    3. Follow steps outlined in Restoring the MangoApps DB from Backup (above) to migrate the data to the new instance

  3. Restoring (uncompressed) MangoApps Documents to the correct location - If you executed this command to compress the top-level directory containing the MangoApps documents: tar -zcpvf beta_opt_mango_storage.tar.gz /opt/mango/storageyou can simply move the archive to the new server and execute this command to uncompress it: tar -zxpvf opt_mango_storage.tar.gz -C /opt/mango/storageThe result of the command will be that all the files in the archive will be placed in the proper subdirectories under/opt/mango/storage/.

4. Running database migration - This step is required only if version of code on the new server is not the same as that on the original server where the database backup was taken. As this command varies based on software versions, please contact with specific commands for this step.

Please note that once data has been moved to a new database instance, depending on how the server was initially set up, your configuration, and what you are trying to achieve, some configuration files will need to be updated so MangoApps can connect to your new database instance. Please contact us at and we will be happy to discuss the database-level commands that should happen next.

Last updated