Migration of databases

Discussion in 'General' started by pyte, Dec 21, 2022.

  1. pyte

    pyte Well-Known Member HowtoForge Supporter

    Hi,
    i have a question about the migration of ISPConfig Servers. As i am migration 2x Webservers and 1x Databaseserver, i've realized, that when i'm migration sites that use a database, they are going to break as the databaseserver that is set in the config files is not correct anyone. For example all wordpress installations will be corrupted after a migration as the databaseserver is set to the old one.

    Does anyone have some advice here? Should i just change the DNS Entry for the databaseserver to point to the new databaseserver and maybe even use the old ip adress on the new server as a 2nd one?

    I appricate any help and thoughts :) Thank you!
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Are you migrating using ISPConfig Migration toolkit?
    I do not think Wordpress installation gets corrupted, just change the dbhost in the configuration file.
     
    pyte likes this.
  3. pyte

    pyte Well-Known Member HowtoForge Supporter

    I do. Yea "corrupted" may be the wrong wording here, but i have to manually edit the configs for those websites to make it work then, which is quiet frustrating, so i thought using the old IP and Name may be a good idea to eliminate the problem.
     
  4. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    are you using ip addresses or hostname for the dbhost settings in the website configs?

    if using the ip addresses, you're only options really are to either switch that ip across to the new db server, or change the ip in all the website configs.

    if you're using the hostnames, you can just change the A records in dns to point to the new ip. or you could change/add it in the webservers /etc/hosts file (this one would let you switch each webserver individually if you're not moving everything in one go)

    that or use grep/awk/sed and the relevant regex to search for any instances of the ip/fqdn in any files in /var/www and under, and replace them with the new ip/fdqn.
     
    pyte likes this.
  5. pyte

    pyte Well-Known Member HowtoForge Supporter

    To be honest, i don't know what users might have used. I hope it's only the hostname.

    I guess this should be fine then. I just switch the Record to the new IP. When something breaks it's the customers fault for using a IP instead of a hostname. This should at least minimize the sites that may break to a minimum.

    Guess that works for me and is a statement which i can argue with, there shouldn't be a IP set as host in the first place.

    Thank you for the help guys!
     

Share This Page