How do I change the url of my MangoApps on-premise domain?
Last updated
Last updated
Create and change to a new directory
mkdir /root/mytemp/dbbkup/
cd /root/mytemp/dbbkup/
Log into MySQL using your MySQL root password [ROOT_PASSWORD] (You must contact MangoApps Support for your MySQL Root Password)
mysql -uroot -p[MY_ROOT_PASSWORD] -h[mysqlhost]
DUMP the database as root user (make sure DB is sg_public not something different)
mysqldump -uroot -p --add-drop-database --add-drop-table --single-transaction --routines --databases sg_public > sg_public_bkup.db
Change old to new everywhere
sed 's/[OLD_DOMAIN_URL]/[NEW_DOMAIN_URL]/g' sg_public_bkup.db > sg_public_bkup_updated.db
Import the changed db back to MySQL
mysql -uroot -p sg_public < sg_public_bkup_updated.db
Get the [OLD_DOMAIN_ID] by querying the domains table with the following. The [OLD_DOMAIN_ID] will be listed in the same row as the [OLD_DOMAIN_URL].
select id,domain_url from domains;
Change one value in the domains table that is subdomain part of your [NEW_DOMAIN_URL]. If your [NEW_DOMAIN_URL] is mysubdomain.domain.com then the [NEW_DOMAIN_KEY] is “mysubdomain”.
update domains set domain_key='[NEW_DOMAIN_KEY]' where id='[ID_OF_OLD_DOMAIN]
DO THESE STEPS ONLY IF YOU ARE CHANGING YOUR DOMAIN URL AFTER MOVING BOTH THE DOCUMENTS AND THE DATABASE TO THE NEW MANGOAPPS INSTANCE AND THEN RESTORING THE FILES AND CONTENT.