Dual Server setup, lost one, need help

Discussion in 'General' started by vigilin, Jan 4, 2022.

  1. vigilin

    vigilin New Member

    Hello everyone. I'm having a bad day.

    I have a dual server setup. Basically one was handling Web Sites and one was handling Email. The Web one crashed from disk errors, and I can't get it fixed. This server was the "Main" database server, as well as the GUI. Both servers are running 14.04.6 LTS.

    I currently have access to everything on the web server, its up and running but its in Read-Only mode because of the disk errors. I took a snapshot in VMWare before trying any recovery. So I can export SQL, and grab any files I might need.

    So here is the million dollar question. What is the easiest way to recreate this server?
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    The easiest way would be to copy the raw disk image and write that to a new HDD, so the system is identical.
  3. vigilin

    vigilin New Member

    The source disk is damaged, I don't think that's an option
  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    I'd start with a backup of all the important stuff (probably of everything, but start with): /etc /var/vmail /var/www /var/lib/mysql /usr/local/ispconfig and check /root and /home for anything you might need. Backup /opt if you have stuff there (eg. compiled php versions), and check /usr/local/. In addition to the /var/lib/mysql directory, attempt to get an sql dump of all your databases. I'd also get a list of all installed package versions and "dpkg --get-selections".

    How many websites are you looking at?

    Since your failed system is outdated, you can run into version issues when trying to restore things to a current OS; you might see if you have 14.04 install media that you could load from and restore to. If so, reinstall packages per your previous selections (I believe it's along the lines of "cat my_old_selections.txt | dpkg --set-selections").

    Then start on restoring databases. I'd rename your new /var/lib/mysql and restore the backup copy; same with /etc/mysql/; hopefully you can work with those and not have to mess with loading sql dumps. Copy /var/www/ and /usr/local/ispconfig/ into place, and /opt if you needed to back it up. I assume there's nothing in /var/vmail to worry about per your description. Ensure you can access mysql with the database credentials from /usr/local/ispconfig/server/lib/config.inc.php and mysql_clientdb.conf.

    Now you'll need to merge your new /etc/passwd with the old one; you're mostly copying ispconfig related entries to the new one, and preserving the system account numbers from your new passwd file (which can differ if packages are installed in a different order). Do the same with /etc/shadow and /etc/group.

    You might verify /etc/hosts entries from your old system and add any that might be needed to the new (eg. the slave/mail server). You might have other services which need configured, like an mta (I generally install postfix even on my web servers, but you may have something else). Probably the pure-ftpd directory can be renamed/copied over. You might want to do the same with ssh, so the server doesn't unexpectedly change keys for your clients.

    I'm sure I'm forgetting something, but at this point I'd try firing up your web server and see if it loads, or troubleshoot errors found if not.
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Import that snapshot to a working WMWare server and start it there. This should be the easiest way to recover.
    Jesse Norell and ahrasis like this.

Share This Page