ISPConfig 3 Migration Experience - CentOS 6.5

Discussion in 'Tips/Tricks/Mods' started by Unfaiir, May 8, 2014.

  1. Unfaiir

    Unfaiir Member

    Introduction:
    This is the tale of my ISPConfig 3 server migration between two CentOS 6.5 servers. I've done a lot of research and info gathering from various places and am combining them in one place, in an easy to reference format. I'm going to go over each of my steps in detail, but I've also created and included a migration script at the end under "Appendix A - ISPConfig 3 - Migration Script" which should help out anyone seeking to perform this rather tedious and mundane task of server transferring ISPConfig to a new server without messing anything up (at least nothing major anyway :D).

    This is mostly for my own satisfaction and personal reference, but I'm sure someone else will benefit too some day, which is a good thing I guess. :cool:

    Protocol 1 - Install ISPConfig:

    Below are the cliff notes of the new server setup:

    • Installed CentOS 6.5 on fresh server
    • Followed Perferct Server Guide to install ISPConfig 3 and related software
    • Created all clients through ISPConfig 3 Interface, with exactly the same client_id, username, company_name and contact_name as the old server
    • Installed as many of the extensions, plugins and additional applications that I could remember that I use from the old server (E.g. PHP extensions, Apache modules, etc...)

    I did not have access to the ISPConfig control panel because my old server was having internet issues so I used mysql to grab the info about the clients that way. If you are ever in the same boat and can't access the web interface, you can use this to get the list of clients from mysql command line:

    Code:
    mysql -u root -pPASSWORD -e "SELECT client_id, username, company_name, contact_name FROM client;" dbispconfig;
    Protocol 2 - Backup Old Server:
    I started with backing up the most obvious things like the databases, web files, logs, mail and server config.

    I don't know exactly which config files from /etc I need yet so I will just pick and choose what I need later.

    I found various posts which talked about backing up users and groups and shadow files. My conclusion is that the best way to handle this is to just create the new users on the new server exactly as they are on the old server and then I don't need to bother with messing with users and groups and shadow files.

    I'm tempted to backup the whole /var and /usr directories, but on second thought decided to spend some time determining the most relevant directories out of these. I didn't want to backup unnecessary things, and definitely not anything that may cause an issue if transferred.

    After much research, I found that what gets backed up depends on what programs you installed since not all ISPConfig installations are even using the same programs. I just went through all my directories and for my particular installation, I ended up backing up the following directories:

    • /etc/cron.d
    • /etc/fail2ban
    • /etc/httpd
    • /etc/my.cnf
    • /etc/named
    • /etc/php.ini
    • /etc/phpMyAdmin
    • /etc/postfix
    • /etc/squirrelmail
    • /usr/lib/courier-imap
    • /usr/local/ispconfig/interface/lib
    • /usr/local/ispconfig/server/lib
    • /var/lib/phpMyAdmin
    • /var/lib/squirrelmail
    • /var/log
    • /var/vmail
    • /var/www
    * Please comment or message if you see anything I missed *

    Protocol 3 - Data Transfer:
    My old server doesn't have a wireless card and for some reason the network card it did have wouldn't connect wired with a dynamic IP.

    I tried to use a switch and hook up the two servers and I could access ISPConfig from the new server via web, but I couldn't get an SSH or FTP connection for some reason, so no way to get the files.

    So finally I went and bought a USB stick, mounted it on the old server, moved my backup onto it, unmounted it, put it in the new server, and then mounted it there.

    So to summarize, there are many ways to do it, but one way or another you need to move your backup files (2 in my case) between the two servers.

    Protocol 4 - Import Old Server Data
    In Progress! Coming Soon!

    Appendix A - ISPConfig 3 - Migration Script:
    I've created migration script to achieve the backup described in Protocol 2 - Backup Old Server. Its pretty simple, but it does all of the backup tasks I've described above and can be pretty easily configured to backup different directories or additional directories. Feel free to check it out and use it.

    I will be adding the import functionality to it once I get Protocol 4 - Import Old Server Data updated on here.

    https://github.com/unfaiir/ispc3-migration
     
    Last edited: May 8, 2014
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    When you move a ispconfig installation, then it is important to copy also the web* users and client* groups over from /etc/passwd, shadow, group and gshadow file. If you wont to that and let ispconfig create new users for the sites with the resync function instead, then the enw users might get different uid's and the migrated wwebsites might fail then due to permission errors.
     

Share This Page