Skip to content

Instantly share code, notes, and snippets.

@b13n1u
Last active February 13, 2018 17:45
Show Gist options
  • Save b13n1u/11094749 to your computer and use it in GitHub Desktop.
Save b13n1u/11094749 to your computer and use it in GitHub Desktop.
I-MSCP migration from old server to a new one.
#Migrate i-mscp to a new server
#the new imscp is already installed and does have a different IP than the old one
#1. Dump the DB and copy the i-MSCP backup to new server:
rsync -rave "ssh -l root" /var/www/imscp/backups 10.0.0.3:/var/tmp/imscp_old_backups
#2.Install the old config DB
#3. Copy all customer data:
rsync -rave "ssh -l root " /var/www/virtual/ 10.0.0.3:/var/www/virtual
rsync -rave "ssh -l root " /var/mail/virtual/ 10.0.0.3:/var/mail/virtual
#4. Copy all cusomer DB's
(use phpmyadmin or mysqldump to move customers db's)
#5. Remove all unix user related fields into the admin table before re-running the installer (on new server)
#- Edit your /etc/passwd file and remove any vuXXXX user
#- Edit your /etc/group file and remove any vuXXXX group
#- Edit your /etc/shadow file and remove any vuXXXX user
#Execute the following SQL queries:
# mysql -u root -p<password>
use imscp; #your imscp config
update domain set domain_status = 'ok';
update subdomain set subdomain_status = 'ok';
update domain_aliasses set alias_status = 'ok';
update subdomain_alias set subdomain_alias_status = 'ok';
update mail_users set status = 'ok';
update admin set admin_status = 'ok', admin_sys_name = null, admin_sys_uid = 0, admin_sys_gname = null, admin_sys_gid = 0;
#5. Run again the setup script:
perl /var/www/imscp/engine/setup/imscp-setup -d
#6. If you need to change the default IP address run:
perl /var/www/imscp/engine/setup/imscp-setup --reconfigure ips
#if it happens that you can not delete the old IP address, check the IP's used by reseller.
# Anything else ?????
@ciscllc
Copy link

ciscllc commented Feb 2, 2016

Thank you. Will try. Would be nice to have a rsync doing the copying between the servers.

@theemstra
Copy link

theemstra commented May 10, 2016

From 1.3.x this script will no longer function, because you can not longer use the mysql root.
A seperate user is created, so this script will have to be altered, by using mysqldump -u imscp_user -p $pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment