Since I had to upgrade my servers many times as my host was offering better deals (more CPU/RAM/HDD) for less money I decided to write this tutorial. So lets find out what you have to do to migrate from old server to new server without issues, as I had plenty of issues when I did it for the first/second time!
- Install new server with tutorial provided by howtoforge.com, there are plenty of “Perfect Server” tutorials there. Since I’m using Debian, this one was mine.
NOTICE: If you have multiserver setup do not join this new server to existing multiserver setup. Just install ispconfig as a standalone setup.
When finished reboot and backup your system:
tar -pczf new_backup.tar.gz /var/vmail /var/log /var/www /etc
mysqldump -u root -pXXXXXXXX –all-databases –events > /var/www/html/new_db.sql
Now open sources list, and copy contents of it somewhere:
We need this for old server in next step.
- On old server, open sources.list delete everything inside of it and paste into it all you have from new server:
Now perform update and keep all configuration when upgrading:
NOTICE: You need to perform dist-upgrade only if your old server is for example running Debian v6 or v7 and your new is v8. If you don’t do this bad things will happen. Make backup:
tar -pczf old_backup.tar.gz /var/vmail /var/log /var/www /usr/local/ispconfig/interface/lib /usr/local/ispconfig/server/lib
tar -pczf etc-old_backup.tar.gz /etc
mysqldump -u root -pXXXXXXXX –all-databases –events > /var/www/html/old_db.sql
Move backups so you can download it to new server or somewhere else:
mv old_backup.tar.gz /var/www/html/old_backup.tar.gz
NOTICE: For Debian v7 and older versions apache web path is /var/www/, starting with v8 path is /var/www/html/
Open /etc/passwords and /etc/shadow and copy only webXXX lines from it somewhere to your PC.
Open /etc/group and /etc/gshadow and copy only clientXXX lines from it somewhere to your PC.
We need to paste those lines to same files on new server!
Open /etc/fstab and copy only lines that contain /var/log/ispconfig/…:
- Go back to new server and download backups from your old server:
tar xvfz old_backup.tar.gz
mysql -u root -pXXXXXX < /old_db.sql
Paste webXXX lines:
Paste clientXXX lines:
Paste /var/log/ispconfig/… lines:
tar xvfz ISPConfig-3-stable.tar.gz
php -q update.php
- On DNS server change your old server IP address with IP of your new server.
- Wait 30 mins to 1 hour… prosper. This depends on your DNS TTL. Mine are 3600 seconds (one hour) so maybe it would be smart to set it even to something like 1 to 100 if possible before migration for faster propagation through Internet.
Have fun and report any issues you encounter!