I-MSCP disaster recovery plan

  • Hello All,

    I am using I-MSCP for about a year now, and I am very happy with. I have a VPS and I am hosting few domains on it.

    Recently I was thinking to simulate a disaster recovery plan, to see how fast and if I can restore the server. So I was looking online to know what part of my UBUNTU server I need to backup to be able to restore it correctly.

    For I-MSCP part, there was only few article I have found, and while I was able to make backups, restoring my test server failed.

    I am opening this thread due to this issue and I would like to get some help from someone who have don this already.

    I will explain step by step on how I did the backups and how I wanted to restore them.

    To backup I-MSCP related files and configs including mysql database I am using the following commands:
    (I am creating a backup files using TAR and one backup for each section instead of having one single backup)

    tar -cpzf imscp.tgz /var/www/imscp/backups/
    tar -cpzf mail.tgz /var/mail/virtual/
    tar -cpzf mysql.tgz /var/lib/mysql/
    tar -cpzf www.tgz /var/www/virtual/

    I am also dumping mysql databases to make sure all ok:
    mysqldump -p --all-databases -u root -p > mysqldump.sql

    Some articles online also suggest to backup /etc/imscp/ however I am not sure if that is really needed, since ubuntu server and I-MSCP will be reinstalled from scratch.

    So, at this stage, I have all backups I should have, so to restore all on a test system, I was doing the following:

    I have created a VM, and installed Ubuntu Server on it, the same version I have on the live system.
    (Please note that first issue will be related to this: new IP and possible different network adapter name)

    I have installed I-MSCP on it the same version I have on the live server.

    At this stage, all ok, I have a new server with I-MSCP on it.

    I have then restored all backed up files, and reimported mysql database as well.

    Now, based on online article (), I should run

    - perl /var/www/imscp/engine/setup/imscp-setup -d

    But I do not have imscp-setup under that location (using latest I-MSCP version)

    So instead on this command, I run the main setup file from the original installer:

    - sudo perl imscp-autoinstall -d

    As far I know, this should re-configure the setup, however it failed with some errors:

    - In original server my network adapter in ens3 but in my test server is ens33, so scrip failed with message saying the network adapter ens3 not exist.

    I have fixed that by renaming network adapter, but then another message, related to the different IP address this test VM have, installer was found the old one possibly from the restored files/database.

    I have changed the IP in mysqldump, reimported it and this error was fixed, but then there was an error related to a subdomain module.

    I have stopped at this stage and considered my disaster recovery plan failed.

    Does anyone have the correct process to backup and restore I-MSCP on same server and different server/hardware/IP ?

    Thank you.


  • I did another test. before importing mysqldump file, I have updated the file and changed IP and Network adapter name under server_ips table section.

    This time, when I run the setup again, all went ok, but admin password was incorrect, so I had to reset in database directly.

    Then finally I was able to login to the panel and have seen all my domains.

    However, all config related to free or paid plugins were lost, so back to square one :(

  • After playing hours with this, I managed to see all domains, emails.... in the control panel. However, when I call one of the domain from the browser, I am only getting the default apache page.

    So while the data are there, nothing works on my test restored server.

    I hope someone have the correct steps to restore full I-MSCP to the same or another server with same or different IP.

  • Hi,

    I am pretty sure you did a search (eg. google) for something like "i-mscp migration" and found this link: , right?

    I am not shure if it works with the latest i-mscp but I did it with this times ago.

    How about virtual servers and simply restore this? For us it is more easy - but you loose some data, as you may not have a 1:1 backup. But for desaster recovery: Better than nothing ;-)

  • Hello, Yes, I have a snapshot of my VPS. I just need to have a backup like daily or so.

    I have seen the article you mentioned however there are few issue with:

    Step1: I am ok with that and did it.

    Step2: not sure what that is mean.

    Step3: all ok

    Step4: I guess this is to import the database we dumped in step1

    Step5: all ok

    However I have not done these SQL statements..

    Step5: This is I guess the biggest issue. There is no file like that under the specified path:

    Under /var/www/imscp/engine/setup/ I have the following files:

    1. root@cp:~# ls -la /var/www/imscp/engine/setup/total 64drwxr-x--- 2 root imscp 4096 Oct 31 14:02 .drwxr-x--- 10 root imscp 4096 Oct 31 14:02 ..-rwxr-x--- 1 root imscp 4648 Oct 31 14:02 imscp-reconfigure-rwxr-x--- 1 root imscp 17684 Oct 31 14:02 imscp-setup-methods.pl-rwxr-x--- 1 root imscp 9529 Oct 31 14:02 imscp-uninstall-rwxr-x--- 1 root imscp 4724 Oct 31 14:02 set-engine-permissions.pl-rwxr-x--- 1 root imscp 3184 Oct 31 14:02 set-gui-permissions.pl-rwxr-x--- 1 root imscp 2019 Oct 31 14:02 updDB.php

    As per step5 I should run:

    - perl /var/www/imscp/engine/setup/imscp-setup -d , but again, the file is just not there:

    1. root@cp:~# perl /var/www/imscp/engine/setup/imscp-setup -d
    2. Can't open perl script "/var/www/imscp/engine/setup/imscp-setup": No such file or directory
    3. root@cp:~#

    So because of this, step6 is the same.

    Do you know why after fresh instal of latest IMSCP I am missing this file?

  • One more issue.

    All restoration went ok, including plugins, except two of them:

    Screen Shot 2017-10-31 at 21.24.11.png

    When I click on the error I see the following:

    - Plugin::OpenDKIM::disable: Couldn't disable the `opendkim' service: iMSCP::Provider::Service::Sysvinit::_exec: Failed to execute operation: No such file or directory at /var/www/imscp/engine/PerlLib/iMSCP/Service.pm line 107.

    - Plugin::SpamAssassin::_checkRequirements: The `spamassassin` package is not installed on your system

    Please note that I have restored all /var/www/imscp/ folder and all others plugins are ok, but these two

    If I click force retry, it will display the same error.

    Perhaps these plugins cannot be restored?

  • and finally the solution was: install the plugins right after the i-mscp setup, then restore the backup

    Or backup and restore also the /var/www/imscp/gui directory...