Best way / tools to migrate master to new hardware

Discussion in 'ISPConfig 3 Priority Support' started by vistree, Dec 6, 2021.

  1. vistree

    vistree Member HowtoForge Supporter

    Hello Team,
    I have already looked around in the forum and found e.g. https://www.howtoforge.com/communit...n-a-multi-server-setup-to-new-hardware.73513/.
    However, since I did not find answers to all my questions, I would like to open a new post here ;-)
    I have an ISPconfig Multiserver Setup. Master with most services except mail. Mail is on a slave server.
    Now I have to migrate the master to a new hardware. Unfortunately I will lose my IP in the process.
    The question now is: What is the best way to migrate to the new hardware and what tools will help best?
    1. where on the master/slave do I have to replace the old master IP with the new master IP?
    2. which tool do I use to migrate everything to do with ISPconfig from the old to the new server? "Migration Tool" or ISPCopy?
    3. is there a guide somewhere for this kind of scenario?
    I know that I have to set up the OS on the new server according to the old master server (I will do this using the related "Perfect Server Setup").
    Thanx for your great support ;-)
    Kai
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

  3. till

    till Super Moderator Staff Member ISPConfig Developer

    The slave server shall stay connected to the master? In this case, you must use ISPCopy as it copies a installation as it is. If you plan to get a new master and new slave server, then use the Migration Tool instead. The Migration tool is more versatile, but it uses an import approach instead of just copying everything, so it can't be used when only one node of a multiserver system shell get moved without detaching other nodes (if it's the master).
     
    Th0m likes this.
  4. vistree

    vistree Member HowtoForge Supporter

    The slave mail server will stay, only the master will be migrated to new hardware. So, I use the ISPCopy, right?
    For changing the IP: are the information from https://www.howtoforge.com/communit...n-a-multi-server-setup-to-new-hardware.73513/ still valid?
    • 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.
    Is there anything additional to be changed on the mail-slave? E.g. in the local mysql on that server?
     
  5. vistree

    vistree Member HowtoForge Supporter

    Hi, I bought the current migration tool today - which is also including ISPcopy. Reading the README.txt I am now a little bit confused:
    "
    ISPCopy can also be used to move a slave node within
    a multiserver system to a new server, this can't be done with
    the Migration Tool.
    "
    Does this mean, I can't use the tool to migrate the MASTER to a new hardware?
    + can someone answer my question regarding the needed IP changes from my previous post?
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    If you want to move the master server to new hardware, and leave all other servers unchanged, you would use ISPCopy. I believe the source and destination servers must be very similar software (same OS version, webserver, etc.).
    That looks accurate.
    Check the ip addr of the master in /etc/hosts (which is in the page you linked to), and make sure pinging it's hostname gets the new address. If you happen to have roundcube installed there, you might need to check your remote api connection info (eg. change it if it's using an ip address; should be fine if it connects to a hostname).
     
  7. vistree

    vistree Member HowtoForge Supporter

    Thanx everyone! Will try to do the migration tonight
     
  8. vistree

    vistree Member HowtoForge Supporter

    Hi all, I now prepared everything for the migration of the master node. But, isp_copy is not working at all ;-(
    Everytime I try to start the tool, a get an error (after inserting my license key):
    "Missing php-json module"
    My machine is using debian buster and old server + new server are setup in the same way.
    php default is 7.3 - but I also tried installing php7.1 on the old master node because related to https://www.howtoforge.com/communit...ter-server-to-a-new-server.83363/#post-396814 it could be a problem with PHP version??
     
  9. vistree

    vistree Member HowtoForge Supporter

    I will open a new ticket!
     
  10. vistree

    vistree Member HowtoForge Supporter

    Hi again, migration is done and all DNS-settings should be changed to the new master IP. But now I have a new problem ;-(
    Opening one of the URLs connected now to the new server, I get a server error:
    Firefox: Fehlercode: SSL_ERROR_RX_RECORD_TOO_LONG
    Chrome: ERR_SSL_PROTOCOL_ERROR
    Any idea? Do I have to force renewing the letsencrypt certs on the new server?
     
  11. vistree

    vistree Member HowtoForge Supporter

    Seems that using control panel Rsync tool solved the problem
     
    till likes this.
  12. vistree

    vistree Member HowtoForge Supporter

    Hi, my migration is done. Using ISPcopy worked quite will. There is just one point, I am a little bit unsure.
    ISPcopy did NOT migrate the database users which are needed to connect from my mail server node.
    I don't know which tutorial I used in the past, but looking around, I found the one from @till
    https://www.howtoforge.com/multiser...se-servers-on-debian-squeeze-with-ispconfig-3
    If I check the database setup on the first page, I can see only users for root being created.
    Am I right, that this root-user should be used in /usr/local/ispconfig/server/lib/config.inc.php on the mail node?
    //** Database settings for the master DB. This setting is only used in multiserver setups
    $conf['dbmaster_type'] = 'mysql';
    $conf['dbmaster_host'] = 'MAINSERVER-IP';
    $conf['dbmaster_port'] = '3306';
    $conf['dbmaster_database'] = 'dbispconfig';
    $conf['dbmaster_user'] = 'ispcsrv3';
    $conf['dbmaster_password'] = 'MYSECRETPASSWORD';
    $conf['dbmaster_new_link'] = false;
    $conf['dbmaster_client_flags'] = 0;

    And it seems, the database connection has also to be defined in /usr/local/ispconfig/server/lib/config.inc.php

    I'm asking, because I find the funny user ispcsrv3 in my config file, and restoring the user did some problems regarding the grants used on the old server ...
    Using till's tutorial, the mysql-user root should be used, right?
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    No, the root user is required to install ISPConfig on the slave nodes and to do updates on the slave nodes. the root user password and account is not permanently used or stored in ISPConfig on the slave node for security reasons.

    Add a new root user in MySQL master database that is able to connect from slave node (the root user should allow access via IP and slave node hostname). Then run an ispconfig update on the slave node (ispconfig_update.sh --force) and let the updater reconfigure permissions in master database, this will recreate the missing ispcsrv* user.
     
  14. vistree

    vistree Member HowtoForge Supporter

    Thanx till, this was really helpfull!! Should I remove the section from the config files first? Or will ispconfig_update reuse the settings (like password) from the config files?
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Please don't remove it as that's the info that the updater uses to recreate the ispcsrv* users on the master.
     
  16. vistree

    vistree Member HowtoForge Supporter

    Thanx till - this worked and the sipcsrv* users are back ;-)
     
    till likes this.

Share This Page