[solved] Restore client

Discussion in 'ISPConfig 3 Priority Support' started by liane, Apr 26, 2018.

  1. liane

    liane Member HowtoForge Supporter

    Hi,
    I had the great idea to do some clean-up on my ISPConfig, and I deleted some unused clients, easy does it, just ask if I'm sure and they're gone.
    Well, it appears that one had some websites assigned, and guess what... poof, no surprise, also gone in a flash.
    Fortunately, the whole server has a daily backup, so I restored the whole thing on a temp machine, redirected the websites IPs and I'm up again.
    Now, my question: before I do anything else stupid, what is the correct way to restore this client and his websites to the original server?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    This depends a bit on which changes have been made in ISPConfig since then. If there have been no changes, then you might be able to restore the whole dbispconfig database from backup and then restore the website directory, email directory of the mail domain etc. If there were changes in ISPConfig, then you have two options. The first one is that you fetch the record of the client from client table on backup system and then insert it on the current system, then do that with web_domain tables and all other tables that contain data of that client. The other option, in case you have a migration tool license, is that you run the migration tool on the backup system and choose to import only this one client back into the original system.

    ./migrate --only-client=username

    But I did not test this with the migration tool yet, so you should do a dry run first and then check the migrate.log file to see what would be actually imported on real run to ensure that not too many things get imported and nothing gets messed up. A dry run with the migration tool can be made without owning a license as a test with license key 'trial'.
     
  3. liane

    liane Member HowtoForge Supporter

    Thanks for that quick answer!
    I'll start with the first option, I guess that incrementally moving things might be less dangerous right now!
    It was easy to recreate the client using phpmyadmin on both servers, that's a good start. I guess that it will be quite easy to restore the directories and dbs, as well as find the bits that are in web_* and other tables, but I'm wondering:
    Now that the backup server is running, I turned on the backup option on the concerned websites, wouldn't it be possible to:
    1) force the backup to occur right now (instead of waiting 'til tomorrow)
    2) restore these backups on the main server (even if the websites don't exist yet there)?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The backup contains the website data (files) and the content of the database (if the website has one) only, so this won't help you with the restore process. Besides that, you can not restore a backup for a non-existing site, so you'll have to re-insert the data in dbispconfig anyway. After you did that, edit a setting in the website, e.g. increase quota, and press save. This will recreate the website directory. Then copy the website data back with e.g. scp or rsync command from backup server.
     
  5. liane

    liane Member HowtoForge Supporter

    Ok, I suspected that would be too easy :rolleyes:
    Thanks for these detailed explanations, I should be up soon
     
  6. liane

    liane Member HowtoForge Supporter

    All is ok.
    I had some quirks along the way, but sorted it all... almost.
    When restoring the files, I was surprised of permission errors, even when root. I had to chattr -i the web folders to be able to write. I restored this attribute after copying the files.
    One last strange thing: when doing any change in a website config, I receive 2 mails stating that apache couldn't restart, one of them saying:
    26.04.2018-14:24 - WARNING - Reason for Apache restart failure: Failed to restart apache2.service: No such method 'RestartUnit'
    See system logs and 'systemctl status apache2.service' for details.
    System Debian 9.4 up to date
    Apache 2.4.25
    Maybe I goofed something, or it was there before but I didn't noticed?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Check if you have a symlink in /etc/apache2/sites-enabled/ folder that points to a non existing file in /etc/apache2/sites-available/
     
  8. liane

    liane Member HowtoForge Supporter

    All the symlink are ok, but I found (a part of) the culprit: systemctl not working ok here, because even this one give error:
    systemctl status apache2.service
    So, it has nothing to do with the restore which is done right. You can mark this as "solved", thanks again.
     
    till likes this.

Share This Page