ISPConifg Server Migration - Mirror Setup

Discussion in 'Installation/Configuration' started by daniel712, Mar 10, 2020.

  1. daniel712

    daniel712 New Member

    Hi Friends,
    i want to migrate my server (email, web, matrix, etc).
    In the first step i followed the chapter 3.3 in the ispconfig Manual to setup a mirror with mysql Master/Master Replication and used unison and dovecot to sync /var/www and email accounts.
    Very nice.
    Now how to switch from the "old" server to the mirror? If i set the new IP in my /etc/hosts file for testing it doesn't work, because the IPs of the "old" server are set in the nginx vhost config files...
    Also all the vhosts are empty after sync and transferred to .err (i think due to the wrong ip?)

    I thought it would be a good idea to migrate through a mirror setup in the first step and then activate it... was not?

    Thanks for help and GREAT WORK (ispconfig)!

    Best regards from Würzburg,
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Sadly it was not. Using a mirror setup is not a way to migrate a system and a mirror must be setup when you install the server before you start adding the first websites.

    The easiest way to migrate a server is by using the migration toolkit:

    If you are seeking for a 'free' way in doing this, then there are several threads here in the forum about that topic which describe what needs to be copied to the new server in case of a migration.
  3. daniel712

    daniel712 New Member

    I will have a look to migration tool...
    Is it a collection of scripts, may i review those, to learn something? Because i want to do the migration for learning how to do this, not just blindly let it run through...
    Perhaps i will find some how-to here where the topic of migrating the ispconfig installation is covered... Do you if there is any special how-to therefore?

    Is it also a way to just do a new install and then copy over the contents?

    Thanks again!
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    No. If you want to learn more about the inetrnals and how to do such a migration, then better do it manually by following instructions that you can find here in the forum.
  5. daniel712

    daniel712 New Member

    It's quite difficult to find a how-to for migration without migration tool...

    I found one method, rsync the complete server to the new instance. Would be worth a try.

    Would you personally do the rsync method for migration or setup a new system with ispconfig and copy over the db and the contents?

  6. till

    till Super Moderator Staff Member ISPConfig Developer

  7. daniel712

    daniel712 New Member

    Thanks a lot, i will start the migration again this way...

    During the new setup i will also use encrypted harddisks. Do you prefer LUKS on LVM Setup, leave the root LVM unencrypted for startup and only use LUKS on home, var and tmp. Or do you recommende LVM on LUKS to encrypt the whole disk (only restart possible with manual intervention, password)?

  8. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    We encrypt the entire disk (lots of sensitive info in /etc, as other locations) and use mandos to unlock the disk automatically on boot. (We have multiple LUKS keyphrases setup, two "short" ones that are typeable, and 2 long ones, one placed on each of our mandos servers.) It requires the mandos server(s) in place, but works nicely.
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    I'm not using any encrypted disks on my servers, so I can't recommend a setup.
  10. daniel712

    daniel712 New Member

    What about the IP addresses after the migration to the new server?
    When i dump and import the databases all the settings in ispconfig are the same as on the origin server, e.g. also th ip address?

    Thanky for your help!
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    When the Ip address changes, then you'll have to change it in ISPConfig after you migrated the server.
  12. daniel712

    daniel712 New Member

    Is there something more to watch for regarding the dns change (new ip)?
    My plan is as like this:
    1) Check everthing up and running with a simple change in my testmachine's /etc/hosts
    2) Keeps sites and mails in sync with unison
    3) Redirect some site's with a proxy_pass to the new server
    4) Set the new ip in the dns settings

    Thanks 4all! Hoping for a good migration... :)
  13. daniel712

    daniel712 New Member

    The Website Migration seems to be ok. :)

    The Email Server is not yet running (unknown recipient...). I think i have to set the server_id in the database to the new server_id, korrekt?

    How do i do this?
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    If old and new server are single server systems, then the ID has been set to 1 during install, so that should match.
  15. daniel712

    daniel712 New Member

    Yes you are right...
    I think, the problem with postfix arised because of some missing config files in /etc ...
    What's the best stragedy to renew the configs in /etc after the new ispconfig install?
    1) import the mysql dump and afterwards run the ispconfig update and renew the configuration automatically?
    2) or check wich files are modified after the ispcong install in /etc, import the mysql dump and afterwards manually adjust the files from the etc.tar.gz of the old server with vimdiff or similar?

    What about manual config inserts (e.g. opendkim in postfix...). I remember, there was a place where to put these manual inserts in templates to ensure they don't get lost during an update of ispconfig with renewal of the the services... Where was this location?

    Thanks again!
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    that's the way I use. Basically, all config files should be in place anyway as you must have installed ispconfig on the system before you start with the migration.

    ISPConfig does dkim signing trough amavis or rspamd, so opendkim should not be used. You can put modified server config templates in /usr/local/ispconfig/server/conf-custom/ and /usr/local/ispconfig/server/conf-custom/install/ for templates of the installer.
  17. daniel712

    daniel712 New Member

    Ok. thanks...
    Another Question: How do you manage the PHP Upgrades?
    E.g. i have php 7.3.16 installed in /opt on Port 8999. When a new php Update comes out, may i compile it and copy it over the previous install in /opt?
    Or do i have to install to a different directory (e.g. /opt/php-7.3.15, /opt/php-7.1.16, and so on...). That's what i did until now. Everytime i take another Port, switch over the Sites to the new Install in ISPConfig and then, if everything works fine, get rid of the old ínstall...
    How do you do php updates?

  18. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    I install php versions from the repo's, so upgrading amounts to 'apt-get update; apt-get upgrade -y'.

    That's the painful way, it'd be easiest to just switch. I had started down the self-compiled route initially (prior to knowing about the repos, or possibly even them existing) and I planned to use symlinks for the major php versions to point to the latest release, so eg. /opt/php-7.3 -> /opt/php-7.3.15 ... an update would then go into /opt/php-7.3.16, and I would have to manually stop the old processes, change the symlink, and start them up again. I imagine config files would need copied/moved from the old version to the the new as well, but I never actually got around to updating php in that configuration so I'm not 100% certain of the steps needed.

    Just install from the repo's, it's much nicer.

Share This Page