preload
Oct 30

Continuing with the sysadmin tasks, now i will tell you about one of my latest experiences, migrate a running ISPconfig from one server to another one.

First, we must clear some restrictions:

  • The old and new version of ISPconfig is strongly recommended that they be the same
  • It is recommended that both servers have the same type of Linux distribution
  • Don’t interrupt the old server service or the acces to it
  • We need ssh access to both servers

Well, let’s go.

Basically, i followed this tutorial at howtoforge, but with some things i had to apply imagination and my own experience.

Steps:

  1. Prepare ISPConfig setup in the new server
  2. Install ISPConfig in the new server
  3. Check new server ISPConfig Installation
  4. Transfer ISPConfig data
  5. Check new server ISPConfig with old server data

Prepare ISPConfig setup in the new server
In a few days i will write a new entry talking about this, but by the moment i let you this link to ISPConfig page, where you can find a list of links to howtoforge tutorials about perfect setups for ISPConfig. If your ISPConfig version is 2.x.x this is your link, for 3.x.x version this other at the top of the document.

Install ISPConfig in the new server
Also in some days, i will write an other entry talking about the installation of ISPConfig, by the moment you can follow the official ISPConfig tutorials for the 3.x.x version and the 2.x.x version, in the version 3.x.x you can found the ISPConfig installation tutorial in the last pages of the perfect setup for your linux distribution, for the 2.x.x you found the ISPConfig tutorial at the end of the tutorials links list.

Check new server ISPConfig installation
Now its the time to check if your new and empty ISPConfig works fine. Check if the admin interface is correct and loads fine.

Transfer ISPConfig data
This is the strength of this entry, follow the steps in order.

  1. Run the following commands, to stop some services:
    • sudo /etc/init.d/postfix stop
    • sudo /etc/init.d/proftpd stop
    • sudo /etc/init.d/apache2 stop
  2. Transfer this information (files and directories) from the old server to the new server, to a work directory like as /home/usr/migration :
    • /etc/passwd
    • /etc/shadow
    • /etc/group
    • /etc/sgroup
    • /etc/apache2/vhosts/Vhosts_ispconfig.conf
    • /etc/postfix/local-host-names
    • /etc/postfix/virtusertable
    • /etc/bind/named.conf
    • /etc/bind/pri.*
    • /etc/proftpd*.conf
    • Generate backups of your MySQL databases

    If you were and advanced user or feel brave… you can try with rsync. But you will need root access via ssh to the new machine.

    sudo rsync -avu /var/www user@server:/var/

    You can modify the command for the other files and directories. Rsync performed copies of directories and files, with the extra-feature of if not is the first once that you called him from the same origin and destiny directories, its only transfer the updates and modifications. Interesting ;)

  3. If you’ve used the first option, follow the same order that is in the list of files to copy the files to their new location. If instead you’ve elected the rsync method, follow the order for the rsync calls.
  4. Edit the /etc/postfix/local-host-names and replace the old server name by the new server name.
  5. Edit the /etc/postfix/virtusertable and find if you can view any entry of the old server, if exists replace by the new server.
  6. Edit the /etc/postfix/main.cf and search the parameter virtual_maps, replace the value for this:

    virtual_maps = hash:/etc/postfix/virtusertable

  7. Now we can starts all the stopped services…
    • sudo /etc/init.d/postfix start
    • sudo /etc/init.d/proftpd start
    • sudo /etc/init.d/apache2 start
  8. Take special attention to the start of stopped services, if one or more of them throws errors…
  9. Restore the database backups from old server in new server
  10. Go to ISPConfig at the new server and go to this option Management->Server->Settings and change IP address and the NS records for the appropiate for the new server.

Take care, if you have replaced the new server’s /etc/shadow file with the /etc/shadow file of the old server, you password can be changed.

Check new server ISPConfig with old server data
You can do the follow checks:

  • Check if all the databases are correctly created at the new server, included ispconfigdb and mysql.
  • Try to do login with an old server user in something, for example, an e-mail account
  • If the previous check works, try with another account diferent

If all the checks are corrects, it seems that all is OK, congratulations!

Hope that helps you. Feel free to ask ;)

Related Posts:




One Response to “ISPConfig: Migrate to a new server (Debian)”

  1. uberVU - social comments Says:

    Social comments and analytics for this post…

    This post was mentioned on Twitter by blueplasticblog: New blog post: ISPConfig: Migrar a un nuevo servidor (Debian) http://mbekh.th8.us...

Leave a Reply

*

Bad Behavior has blocked 462 access attempts in the last 7 days.