How to migrate one node in a multi-server setup to new hardware

Discussion in 'ISPConfig 3 Priority Support' started by Steinbruch, Jul 15, 2016.

  1. Steinbruch

    Steinbruch Member HowtoForge Supporter

    Ok since I finally got around to subscribing (had planned to do so for a long time...) I might as well try my question here:
    I have a multi-server setup with one dedicated ISPconfig master, several email and web servers.
    Now I want to replace a pretty old machine with new hardware - due to the way the data center operates, I will lose the associated IP address, so I'll have to take care to do all the DNS updates myself, which is not a problem.

    The idea I had was:
    Can I set up the new machine as a mirror of the existing server?
    If I then switch the DNS to point to the new machine, will it be transparent to the users if I drop the old machine from the setup?

    Or is there a better way that I simply fail to see?

    Thanks a lot for this outstanding product - it has made my life a lot easier over the last couple of months.

    Thanks,
    Jerry
     
  2. Steinbruch

    Steinbruch Member HowtoForge Supporter

    Ok maybe I was thinking a little too complicated.
    Please correct me if I'm wrong - is all there is to a hardware/IP migration to set up the new server under the same name (not IP) as the old one, load the backup, reconfigure/resync all services and that's it?
    Would come with an outage for affected customers but setting up a new machine is just a matter of a little over an hour, so that's all doable.
    I'd just like to replace old machines with minimized impact if at all possible :)
    Thanks,
    Jerry
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    I would move the complete OS over, if possible. E.g. by using a backup, so that the new server simply has the same hostname, ip and system configuration then the old one. Using the mirror function will not work as you won't be able to remove the master of the mirror (old server) then.
     
  4. Steinbruch

    Steinbruch Member HowtoForge Supporter

    Thank you Till - the problem is that I cannot port the IP - the data center is not exactly flexible on that point. The new machine will definitely get a different IP address (generally, it will be desirable to be able to migrate across IP ranges as I might eventually want to change data centers entirely and would have to update all IP addresses in the process)
    Can I restore the replacement machine from a backup of the previous server and "hack" the database in some places to accept the new IP address, or is there some kind of unique server key somewhere in the background that can't be tampered with?
    Thanks,
    Jerry
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, that's no Problem. You have to alter the IP in the following places:

    • /etc/hosts file (if the hosts files on the other nodes contain this IP as well, then alter it there too).
    • The /usr/local/ispconfig/server/lib/config.inc.php should contain the hostname, not the IP. So altering this file should not be required.
    • In the MySQL database on the master, there you can find the ispcsrv[ID] user that this slave uses to connect twice, once with the hostname (does not need to be altered) and once with the IP (needs to be altered). The best way is to use the user editor of phpmyadmin to do that as the permissions are a bit complicated and splitted to various sub tables and the user editor in phpmyadmin handles this for you so you, so just change the Ip with the user editor.
    • If this node is a web server and you used the IP instead of * in websites, then you have to change the IP in ispconfig under System > IP addresses (or better add the new one and leave the old one there until you changed the sites) and then select the new IP in all websites that use it.
     
  6. Steinbruch

    Steinbruch Member HowtoForge Supporter

    Ok cool - thanks a lot for that help. I've got a spare machine set up in the basement where I'll try just that prior to applying the same in production.
    This will save me a huge amount of work.
    Thanks,
    Jerry
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Just for the understanding how ispconfig works: The slave connects to the mysql database of the master and pulls changes from there. So if something stops working on migration, then the first thing to diagnose is that it is possible to connect from the slave to the master server with the master database details from /usr/local/ispconfig/server/lib/config.inc.php file.

    And this can help you then as well: http://www.faqforge.com/linux/debugging-ispconfig-3-server-actions-in-case-of-a-failure/
     

Share This Page