How to restore Plesk installation on a new Windows server after disaster

Created:

2016-11-16 12:53:20 UTC

Modified:

2017-08-08 13:12:01 UTC

2

Was this article helpful?


Have more questions?

Submit a request

How to restore Plesk installation on a new Windows server after disaster

Applicable to:

  • Plesk for Windows

Table of contents

Symptoms

During the course of disaster recovery, it is necessary to set up a new Plesk instance and migrate all server settings and customer data from the old server.

Resolution

We strongly recommend restoring the server from a server backup. It will be the best way to solve the issue.

Also, the following instructions can be used, but we can not guarantee no issue will be faced.

Please note that server configuration (paths) should be exactly the same.

Let us assume that:

plesk_dir=C:\Program Files (x86)\Plesk\
plesk_vhosts=C:\Inetpub\vhosts\

Create a server with exactly the same version of Plesk with the same set of tools installed, with the same DB providers and same IP addresses.

Mount HDD from crashed server on the new server (we assume it is D:\).

Connect to the server using RDP.

Plesk Onyx and Plesk 12.5

  1. Stop all Plesk services in Plesk Services Monitor:

    pleskmonitor.png
  2. Copy Web Prescense Builder configuration file and websites folder:

    D:\Program Files (x86)\Plesk\sb\config to C:\Program Files (x86)\Plesk\sb\config

    D:\Program Files (x86)\Plesk\sb\sites\ to C:\Program Files (x86)\Plesk\sb\sites\

  3. Copy applications cache folder D:\Program Files (x86)\Plesk\var\apspackages to C:\Program Files (x86)\Plesk\var\apspackages

  4. Copy Horde DB password file from D:\Program Files (x86)\Plesk\Webmail\horde\conf\.horde.shadow to C:\Program Files (x86)\Plesk\Webmail\horde\conf\.horde.shadow 

  5. Copy Plesk databases:

    MySQL - D:\Program Files (x86)\Plesk\MySQL\Datato C:\Program Files (x86)\Plesk\MySQL\Data

    MSSQL - copy D:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data to C:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data Attach Plesk database using Microsoft SQL Server Management Studio or any other MSSQL Management Utility.

  6. Copy websites content from D:\Inetpub\vhosts to C:\Inetpub\vhosts

  7. Copy mail content:

    MailEnable Server - D:\Plesk\Mail Servers\Mail Enable , folders Config , Postoffices , Queues .

    SmarterMail Server - copy D:\SmarterMail to C:\SmarterMail with content only in the end of this instruction.

  8. Copy Databases from D:\Program Files (x86)\Plesk\Databases\MySQL to C:\Program Files (x86)\Plesk\Databases\MySQL 

    The same operation for C:\Plesk\Databases\MSSQL  Attach MSSQL databases using Microsoft SQL Server Management Studio or any other MSSQL Management Utility.

  9. Start Plesk services in Plesk Services Monitor.

  10. Set Administrator password in cmd exactly the same as on crashed server:

    C:\> "%plesk_bin%\plesksrvclient.exe" -set setup

    If you have any issues with resetting password with plesksrvclient.exe utility, restore MySQL "admin" password according to the following article How to reset MySQL administrator password on Windows

  11. Restore MSSQL "sa" password with MSSQL Management Studio .

    Reconfigure MSSQL Webadmin:

    C:\> "%plesk_cli%/repair" --reconfigure-mssql-webadmin-site
    C:\> "%plesk_cli%/repair" --update-mssql-users-permissions

  12. Find and rename/delete all '.Security' files in vhosts folders:

    C:\> for /F "skip=1 usebackq" %r in (`dbclient.exe --direct-sql "--sql=select name from domains"`) do move "%plesk_vhosts%"\%r\.plesk\.Security "%plesk_vhosts%"\%r\.plesk\.Security.old

  13. Open Windows Registry and load D:\Windows\System32\config\SOFTWARE hive according to Load or Unload Registry Hives.

    Export NEW_HIVE\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PLESK\PSA Config\Config\sym_key from loaded hive. Unload hive, edit the path in exported registry file removing the temp folder name and double-click on it to import.
  14. Create all system users in Windows OS using cmd.exe:

    C:\> "%plesk_bin%\dbclient.exe" --direct-sql --sql="SELECT su.login,accounts.password,su.home FROM sys_users su LEFT JOIN accounts ON su.account_id=accounts.id" > accounts.list.txt
    C:\> for /f "skip=1 tokens=1-3" %x in (accounts.list.txt) do "%plesk_bin%\usermng.exe" --add --name=%x --password=%y --home=%z

  15. Run Plesk Reconfigurator and perform Repair Plesk Installation > Plesk Virtual Hosts security - it recreates systems users and restores permissions:

    pleskmonitor2.png

  16. Recreate domains in IIS Web server executing these commands in cmd.exe:

    C:\> plesk repair web -y

  17. Reconfigure FTP executing the command in cmd.exe:

    C:\> plesk repair ftp -y

  18. Reconfigure Mail server executing the command in cmd.exe:

    C:\> plesk repair mail -y

    In case of Webmail issues please reinstall Horde .

  19. Update DNS zones:

    C:\> plesk repair dns -y

  20. Copy SmarterMail content.

Plesk 10.x-12.0

  1. Stop all Plesk services in Plesk Services Monitor:

    pleskmonitor.png
  2. Copy Web Prescense Builder configuration and websites:

    D:\Program Files (x86)\Plesk\sb\config to C:\Program Files (x86)\Plesk\sb\config

    D:\Program Files (x86)\Plesk\sb\sites to C:\Program Files (x86)\Plesk\sb\sites

  3. Copy applications cache D:\Program Files (x86)\Plesk\var\apspackages into C:\Program Files (x86)\Plesk\var\apspackages

  4. Copy Horde DB password from D:\Program Files (x86)\Plesk\Webmail\horde\conf\.horde.shadow to C:\Program Files (x86)\Plesk\Webmail\horde\conf\.horde.shadow 

  5. Copy Plesk databases:

    MySQL - copy D:\Program Files (x86)\Plesk\MySQL\Data to C:\Program Files (x86)\Plesk\MySQL\Data

    MSSQL - copy D:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data to C:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data Attach Plesk database using Microsoft SQL Server Management Studio or any other MSSQL Management Utility.

  6. Copy content from D:\Inetpub\vhosts to C:\Inetpub\vhosts

  7. Copy mail content:

    MailEnable Server - D:\Plesk\Mail Servers\Mail Enable , folders Config , Postoffices , Queues .

    SmarterMail Server - copy D:\SmarterMail to C:\SmarterMail with content only at the end of this instruction.

  8. Copy Databases from D:\Program Files (x86)\Plesk\Databases\MySQL to C:\Program Files (x86)\Plesk\Databases\MySQL 

    The same operation for C:\Plesk\Databases\MSSQL  Attach MSSQL databases using Microsoft SQL Server Management Studio or any other MSSQL Management Utility.

  9. Copy certificates from D:\Program Files (x86)\Plesk\var\certificates to C:\Program Files (x86)\Plesk\var\certificates

  10. Start Plesk services in Plesk Services Monitor

  11. Set Administrator password in cmd exactly the same as on crashed server:

    C:\> "%plesk_bin%\plesksrvclient.exe" -set setup

  12. Restore MSSQL "sa" password with MSSQL Management Studio .

    Reconfigure MSSQL Webadmin:

    C:\> "%plesk_cli%/repair" --reconfigure-mssql-webadmin-site
    C:\> "%plesk_cli%/repair" --update-mssql-users-permissions

  13. Find and rename/delete all '.Security' files in vhosts folders:

    For Plesk 11 and Plesk 10.x:

    C:\> for /F "skip=1 usebackq" %r in (`dbclient.exe --direct-sql "--sql=select name from domains"`) do move "%plesk_vhosts%"\%r\.Security "%plesk_vhosts%"\%r\.Security.old

    For Plesk 11.5 and Plesk 12.0:

    C:\> for /F "skip=1 usebackq" %r in (`dbclient.exe --direct-sql "--sql=select name from domains"`) do move "%plesk_vhosts%"\%r\.plesk\.Security "%plesk_vhosts%"\%r\.plesk\.Security.old

  14. Open Windows Registry and load D:\Windows\System32\config\SOFTWARE hive according to Load or Unload Registry Hives.

    Export NEW_HIVE\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PLESK\PSA Config\Config\sym_key from loaded hive. Unload hive, edit the path in exported registry file removing the temp folder name and double-click on it to import.

  15. Create all system users in Windows OS:

    C:\> "%plesk_bin%\dbclient.exe" --direct-sql --sql="SELECT su.login,accounts.password,su.home FROM sys_users su LEFT JOIN accounts ON su.account_id=accounts.id" > accounts.list.txt
    for /f "skip=1 tokens=1-3" %x in (accounts.list.txt) do "%plesk_bin%\usermng.exe" --add --name=%x --password=%y --home=%z

  16. Run Plesk Reconfigurator and perform Repair Plesk Installation > Plesk Virtual Hosts security - it recreates systems users and restores permissions.

  17. Recreate domains in IIS Web server:

    For Plesk 11.0:

    C:\> "%plesk_bin%\websrvmng.exe" --reconfigure-all

    For Plesk 11.5 and Plesk 12.0:

    C:\> "%plesk_bin%\dbclient.exe" --direct-sql --sql="SELECT displayName FROM domains" > domains.txt
    C:\> for /f "skip=1" %i in (domains.txt) do "%plesk_dir%\bin\repair.exe" --reconfigure-web-site -web-site-name %i
    C:\> "%plesk_dir%\bin\repair.exe" --synchronize-protected-directories-storage
    C:\> "%plesk_dir%\bin\repair.exe" --repair-all-webspaces-security
    C:\> "%plesk_dir%\bin\repair.exe" --synchronize-impersonation-storage
    C:\> "%plesk_dir%\bin\repair.exe" --synchronize-protected-directories-storage
    C:\> for /f "tokens=*" %d in ('type C:\domains.txt') do "%plesk_dir%\bin\repair.exe" --repair-webspace-security -webspace-name %d

  18. Reconfigure FTP:

    For Plesk 11.0:

    C:\> "%plesk_bin%\ftpmng.exe" --reconfigure-all

    For Plesk 11.5 and Plesk 12.0:

    C:\> "%plesk_dir%\bin\repair.exe" --reconfigure-ftp-sites

  19. Reconfigure Mail server:

    C:\> "%plesk_bin%\mchk.exe" --all --fix=all

    In case of Webmail issues please reinstall Horde

  20. Update DNS zones:

    C:\> "%plesk_bin%\dnsmng.exe" update *

  21. Copy SmarterMail content if required.
Have more questions? Submit a request
Please sign in to leave a comment.