How to restore from hardware failure

Discussion in 'ISPConfig 3 Priority Support' started by DantePasquale, Nov 1, 2019.

  1. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Hi All,
    Yes, once again a server has died and I'm going to move this to Linode for now, until I can get it replaced :(
    I have fairly recent backups of ISPConfig but what is the best way to go about this?
    1. Install OS Instance and create same users and volumes
    2. Follow instructions for installation of ISPConfig and its required packages
    3. Now, do I restore from the backup or do I recreate pretty much from Scratch??? I really just need email to work for now, the websites can wait.
    Here's what I see in the backups folder - it's a few days old as is the vmail folder, but that's OK for me:

    drwx------ 2 root root 4096 Oct 2 23:14 .
    drwxr-x--- 20 root root 4096 Oct 2 23:14 ..
    -rwx------ 1 root root 7861731 Oct 2 23:14 etc.tar.gz
    -rwx------ 1 root root 1073215 Oct 2 23:14 ispconfig_db_backup.sql
    -rwx------ 1 root root 38781497 Oct 2 23:14 ispconfig_software.tar.gz​

    I have this backup of mysql but I don't think it's very helpful:
    -rw-rw---- 1 rtkit saned 50331648 Oct 26 03:10 ib_logfile1
    -rw-rw---- 1 rtkit saned 18874368 Oct 26 03:10 ibdata1
    -rw-rw---- 1 rtkit saned 50331648 Oct 26 03:10 ib_logfile0
    drwx------ 2 rtkit saned 4096 Oct 26 03:15 c2_piwigo
    drwx------ 2 rtkit saned 4096 Oct 26 03:15 c2_wp
    drwx------ 2 rtkit saned 12288 Oct 26 03:15 dbispconfig​
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I would do it li8ke this:

    1) install ISPConfig as usual.
    2) Copy the web* users and client* groups back by using the backup files in the etc.tar.gz backup, but only the users and groups, not the whole files. the files that need to be edited are /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow
    3) Restore the dbispconfig database from backup.
    4) use Tools > resync in ispconfig, select all checkboxes and let ispconfig recreate the missing config files.
    5) Restore /var/vmail and /var/www

    There ares everal threads about moving an ispconfig installation to a new server, these contain also the information thats needed for such a restore.
     
  3. DantePasquale

    DantePasquale Member HowtoForge Supporter

    I had to use the --force for restoring the dbispconfig database but at least emails are working for now! Mailfilters don't seem to be working, but I may just disable for now
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to run Tools > resync again, this should recreate the mail filters. But normally the filters should have been part of your /var/vmail backup as they are just files.
     
  5. DantePasquale

    DantePasquale Member HowtoForge Supporter

    I should have been more clear, the filters are there but I don't think the folders are, or are no longer subscribed. For example, I have one for ebay.com that puts it into the INBOX.Ebay folder, but I don't see that folder in Thunderbird.

    It's not a big issue and I'll look into it later. Thanks for the help to get the email server up and running ;)
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The subscriptions are also file based and part of the maildir structure if I remember correctly, so they should be there as well.
     
  7. DantePasquale

    DantePasquale Member HowtoForge Supporter

    The subscriptions were there but for some reason Thunderbird didn't use it??? I just had to re-establish the subscription from there.
    New Issue: I can't access webmail - I get the following error from this url: https://TLD/:8081/squirrelmail/
    CONFIGURATION ERROR
    config.inc.php was not found.
    Please read the INSTALL instructions!​

    Not sure what I missed

    Do I need to configure config.inc.php.sample or just rename it?

    root@sterling:~# file /usr/share/squirrelmail​
    /usr/share/squirrelmail: symbolic link to /usr/share/roundcube
    root@sterling:~# locate config.inc.php
    root@sterling:~# ls -l /usr/share/roundcube/
    total 48
    drwxr-xr-x 2 root root 4096 Nov 2 12:24 bin
    -rw-r--r-- 1 root root 996 Apr 14 2018 composer.json
    -rw-r--r-- 1 root root 3848 Apr 14 2018 config.inc.php.sample
    -rw-r--r-- 1 root root 12726 Apr 11 2018 index.php
    drwxr-xr-x 3 root root 4096 Nov 2 12:24 installer
    drwxr-xr-x 29 root root 4096 Nov 2 12:24 plugins
    drwxr-xr-x 8 root root 4096 Nov 2 12:24 program
    drwxr-xr-x 4 root root 4096 Nov 2 12:24 skins
    drwxr-xr-x 7 root root 4096 Nov 2 12:24 SQL
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Which tutorial did you use for the installation?
     
  9. DantePasquale

    DantePasquale Member HowtoForge Supporter

  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Please try to run these commands as root:

    Code:
    chown root:ispapps /etc/roundcube/debian-db.php
    chmod 640 /etc/roundcube/debian-db.php
    chown root:ispapps /etc/roundcube/config.inc.php
    chmod 640 /etc/roundcube/config.inc.php
    chown -R ispapps:adm /var/log/roundcube
    chmod -R 750 /var/log/roundcube
    chown -R ispapps:ispapps /var/lib/roundcube/temp
    chmod -R 750 /var/lib/roundcube/temp
     
  11. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Thanks, that did the trick! I bet it got messed up when I restored some items from backups.
     
  12. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Ok, I finally have new server up and running! I have installed ISPConfig but it's got no data (I didn't create anything).
    So, how best to move it off the cloud and back onto my own server? Isn't there a tool that I can purchase for this? Thanks!

    ---OR, maybe I'll leave just the email on the cloud server and have my own server be webserver -- Can you point me to info on how to do that?
     
    Last edited: Dec 4, 2019
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    The easiest way is probably to use the Migration Tool: https://www.howtoforge.com/tutorial...-confixx-plesk-to-ispconfig-31-single-server/
    You can use the tool also to migrate only parts like leaving mail on the cloud server, see chapter advanced options of the tutorial. The tool has a dry run mode and creates a migrate.log file which shows in detail what will be migrated, so you can try it out even before you buy a license in dry run mode and see in the log what get's migrated when using advanced options like:

    ./migrate --exclude-mail

    to migrate everything except the mail part to your new server.
     
  14. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Migration looks like it starts out OK but then then says Job Failed. Stopping Sync! after an ssh_exchange_identification message:

    I see it's complaining about source file does not exist and, it does NOT exist.
    ls -l /var/www/clients/client0
    total 8
    lrwxrwxrwx 1 root root 30 Nov 25 21:00 cocoanet.us -> /var/www/clients/client0/web1/
    drwxr-xr-x 19 root root 4096 Nov 2 20:02 web1
    drwxr-xr-x 9 root root 4096 Nov 25 21:00 web1_bak_2019_11_26_02_00_05





    [INFO] Target ISPConfig job queue has completed. Continuing.

    [INFO] Skipping system server as we have no job entries for this target.
    [3/57] Syncing /var/www/clients/client0/web1/web to /var/www/clients/client0/web1/
    0 100% 0.00kB/s 0:00:00 (xfr#0, to-chk=0/3)
    [4/57] Syncing /var/www/clients/client0/web1/private/ to /var/www/clients/client0/web1/private/
    0 100% 0.00kB/s 0:00:00 (xfr#0, to-chk=0/1)
    [5/57] Syncing /var/www/clients/client0/web1/home/ to /var/www/clients/client0/web1/home/
    0 0% 0.00kB/s 0:00:00 (xfr#0, to-chk=0/10)
    [6/57] Syncing /var/www/clients/client0/web1/ssl/ to /var/www/clients/client0/web1/ssl/
    0 100% 0.00kB/s 0:00:00 (xfr#0, to-chk=0/1)
    [7/57] Syncing /var/www/clients/client0/web1/cgi-bin to /var/www/clients/client0/web1/
    0 100% 0.00kB/s 0:00:00 (xfr#0, to-chk=0/1)
    [WARN] Source dir/file /var/www/clients/client0/web4/web for web server does not exist. Skipping sync job.
    [WARN] Source dir/file /var/www/clients/client0/web4/private/ for web server does not exist. Skipping sync job.
    [WARN] Source dir/file /var/www/clients/client0/web4/cgi-bin for web server does not exist. Skipping sync job.
    [INFO] Skipping mail server as we have no job entries for this target.in /var/www/clients
    ssh_exchange_identification: Connection closed by remote host
    [ERROR] job failed. Stopping Sync!



    =============
    Migration tool run completed.
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    If it does not exist anymore, then it must show this error. This does not mean that the other sites are broken.
     
  16. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Ok, that makes sense. Because of lack of space on the cloud instance, I did NOT restore the websites.
    What's the best way for me to figure out if the 'new' instance is OK for me to restore the websites onto?? NOTE: my plan is to completely remake them since they were really dated (they are both just for me, anyway ;) )

    I'm not adverse to paying you guys to take a look if you think that would be better.
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    I don't think that this is nescessary, if they show up in ISPConfig on the new system, theny they should be ok.
     
  18. DantePasquale

    DantePasquale Member HowtoForge Supporter

    everything in the control panel looks good! I'll whip up some website code and see if it's working sometime later this week. Thanks for all your help!!!
     
    till likes this.
  19. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Not sure if this is a problem. But on the 'source server that is now just a mail server, I see this in the mail error log:

    Dec 10 00:44:17 sterling dovecot: auth-worker(21966): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) - waiting for 125 seconds before retry
    Dec 10 00:44:24 sterling dovecot: auth-worker(24927): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) - waiting for 125 seconds before retry
    Dec 10 00:44:24 sterling dovecot: auth-worker(24927): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) - waiting for 125 seconds before retry
    Dec 10 00:44:46 sterling dovecot: auth: Error: auth worker: Aborted PASSV request for [email protected]: Lookup timed out
    Dec 10 00:44:46 sterling dovecot: auth-worker(21966): Error: mysql: Query timed out (no free connections for 60 secs): SELECT email as user, password, maildir as userdb_home, CONCAT( maildir_format, ':', maildir, '/', IF(maildir_format='maildir','Maildir',maildir_format)) as userdb_mail, uid as userdb_uid, gid as userdb_gid, CONCAT('*:storage=', quota, 'B') AS userdb_quota_rule, CONCAT(maildir, '/.sieve') as userdb_sieve FROM mail_user WHERE (login = '[email protected]' OR email = '[email protected]') AND `disableimap` = 'n' AND server_id = '1'
    Dec 10 00:44:46 sterling dovecot: auth-worker(21966): Error: sql([email protected],111.92.107.67,<NTLI/lKZcMRvXGtD>): Password query failed: Not connected to database
    Dec 10 00:44:46 sterling dovecot: auth-worker(5276): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) - waiting for 1 seconds before retry
    Dec 10 00:44:46 sterling dovecot: auth-worker(5276): Error: mysql(localhost): Connect failed to database (dbispconfig): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) - waiting for 1 seconds before retry
    Dec 10 00:44:46 sterling dovecot: auth-worker(5276): Error: sql([email protected],78.128.113.125): Password query failed: Not connected to database

    I am able to connect locally via the command line:



    root@sterling:~# mysql -u root -p dbispconfig
    Enter password:
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 18047
    Server version: 10.1.43-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04


    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
     
  20. DantePasquale

    DantePasquale Member HowtoForge Supporter

    Also, some confusion as to the below screens

    Top one, inferno.cocoanet.us what I plan on being the web/dns server - should it Mail be set to No?
    Bottom one, sterling.cocoanet.us should be mail server -- should Web, DNS, and DB be set to No?

    And, shouldn't I see both servers under the 'System Settings'? Each screen shot is from their respective ISPConfig Control Panels.

    Screenshot from 2019-12-11 21-07-03.png Screenshot from 2019-12-11 21-07-39.png
     

Share This Page