How do I restore backed up data and files to my MangoApps on-premise domain?
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-127.0.0.1-20121129-113043.mangodb
cp mangoapps-127.0.0.1-20121129-113043.mangodb mangoapps-127.0.0.1-20121129-113043.sql.gz
gunzip mangoapps-127.0.0.1-20121129-113043.sql.gz
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.
sed ‘s/<old FQDN>/<new FQDN>/g’ mangoapps-127.0.0.1-20121129-113043.sql > mangoapps-127.0.0.1-20121129-113043.sql2
mysql -u[mysqlusername] -p[mysqlpassword] -h[mysqlhost] sg_public < mangoapps-127.0.0.1-20121129-113043.sql (or mangoapps-127.0.0.1-20121129-113043.sql2 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
Migrating the DB to a new MangoApps Instance - To migrate data to a new MySQL instance, please follow these 3 steps:
Create MangoApps database
create database sg_public;
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]';
Follow steps outlined in Restoring the MangoApps DB from Backup (above) to migrate the data to the new instance
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/storage
you 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/storage
The 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 support@mangoapps.com 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 support@mangoapps.com and we will be happy to discuss the database-level commands that should happen next.
Last updated