Applicable to:
- Plesk for Windows
Question
How to restore Plesk installation on a new Windows server after disaster?
Answer
Note: on the new server, the same version of Plesk as on the old one should be installed to the same path, and it should be licensed properly. Also, the same set of components and extensions should be installed on the new server.
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:
CONFIG_TEXT: 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.
-
Open Plesk Services Monitor, click the Select All and then the Stop button in order to stop all Plesk services:
-
Copy Web Presence Builder folders:
-
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\sb\config
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\sb\config
-
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\sb\sites\
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\sb\sites\
-
-
Copy applications cache folder:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\var\apspackages
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\var\apspackages
-
Copy Horde DB password file as follows:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\Webmail\horde\conf.horde.shadow
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\Webmail\horde\conf.horde.shadow
-
Copy Plesk databases:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\MySQL\Data
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\MySQL\Data
-
Copy websites content:
From:
CONFIG_TEXT: D:\Inetpub\vhosts
To:
CONFIG_TEXT: C:\Inetpub\vhosts
-
Copy mail content:
-
For MailEnable Server:
From:
CONFIG_TEXT: D:\Plesk\Mail Servers\Mail Enable\Config
D:\Plesk\Mail Servers\Mail Enable\Postoffices
D:\Plesk\Mail Servers\Mail Enable\QueuesTo:
CONFIG_TEXT: C:\Plesk\Mail Servers\Mail Enable\Config
C:\Plesk\Mail Servers\Mail Enable\Postoffices
C:\Plesk\Mail Servers\Mail Enable\Queues -
For SmarterMail Server:
It will copied in the end of the instruction. Just follow the next steps.
-
-
Copy Databases:
-
For MySQL databases:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\Databases\MySQL
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\Databases\MySQL
-
For MSSQL databases:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data
Attach MSSQL databases using Microsoft SQL Server Management Studio or any other MSSQL Management Utility.
-
-
Export
sym_key
to be able to restore users and passwords:-
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 the loaded hive. - Unload hive, edit the path in exported registry file removing the temp folder name and double-click on it to import.
-
Open Windows Registry and load
-
Open Plesk Services Monitor, click the Select All and then the Start button in order to start all Plesk services:
-
Restore MSSQL password for the
sa
user via MSSQL Management Studio . -
Reconfigure MSSQL Webadmin by executing these commands one by one:
C:\> "%plesk_cli%/repair.exe" --reconfigure-mssql-webadmin-site
C:\> "%plesk_cli%/repair.exe" --update-mssql-users-permissions -
Restore MS SQL users and databases
C:\> "%plesk_cli%/repair.exe" --mssql
-
Find and rename/delete all
.Security
files in thevhosts
folders:C:\> for /F "skip=1 usebackq" %r in (`plesk db -e "select name from domains"`) do move "%plesk_vhosts%"\%r\.plesk\.Security "%plesk_vhosts%"\%r\.plesk\.Security.old
-
Back to the Command Line Console and re-create all system users by executing commands:
C:\> "%plesk_cli%\repair.exe" --synchronize-impersonation-storage
C:\> "%plesk_cli%\repair.exe" --repair-all-webspaces-system-users -
Run Plesk Reconfigurator, click the Repair Plesk Installation button, mark the Plesk Virtual Hosts security checkbox only and click the Check button in order to recreate systems users and restore their permissions:
-
Go to Tools & Settings > Server components > and click Refresh Server Components
-
Back to the Command Line Console and repair SSL certificates:
C:\> plesk repair web -sslcerts
-
Recreate domains in IIS Web server by executing these commands:
C:\> plesk repair web -y
-
Reconfigure FTP by running this command:
C:\> plesk repair ftp -y
-
Reconfigure Mail server by launching this command:
C:\> plesk repair mail -y
Note: in case of issues with the Horde webmail reinstall it.
-
Run the command below to update DNS zones:
C:\> plesk repair dns -y
-
Copy SmarterMail content:
From:
CONFIG_TEXT: D:\SmarterMail
To:
CONFIG_TEXT: C:\SmarterMail
-
Open Plesk Services Monitor, click the Select All and then the Stop button in order to stop all Plesk services:
-
Copy Web Presence Builder folders:
-
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\sb\config
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\sb\config
-
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\sb\sites\
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\sb\sites\
-
-
Copy applications cache folder:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\var\apspackages
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\var\apspackages
-
Copy Horde DB password file as follows:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\Webmail\horde\conf.horde.shadow
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\Webmail\horde\conf.horde.shadow
-
Copy Plesk databases:
-
If it is located on MySQL server:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\MySQL\Data
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\MySQL\Data
-
If it is located on MSSQL server:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data
To:
CONFIG_TEXT: 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.
-
-
Copy websites content:
From:
CONFIG_TEXT: D:\Inetpub\vhosts
To:
CONFIG_TEXT: C:\Inetpub\vhosts
-
Copy mail content:
-
For MailEnable Server:
From:
CONFIG_TEXT: D:\Plesk\Mail Servers\Mail Enable\Config
D:\Plesk\Mail Servers\Mail Enable\Postoffices
D:\Plesk\Mail Servers\Mail Enable\QueuesTo:
CONFIG_TEXT: C:\Plesk\Mail Servers\Mail Enable\Config
C:\Plesk\Mail Servers\Mail Enable\Postoffices
C:\Plesk\Mail Servers\Mail Enable\Queues -
For SmarterMail Server:
It will copied in the end of the instruction. Just follow the next steps.
-
-
Copy Databases:
-
For MySQL databases:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\Databases\MySQL
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\Databases\MySQL
-
For MSSQL databases:
From:
CONFIG_TEXT: D:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data
To:
CONFIG_TEXT: C:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data
Attach MSSQL databases using Microsoft SQL Server Management Studio or any other MSSQL Management Utility.
-
-
Open Plesk Services Monitor, click the Select All and then the Start button in order to start all Plesk services:
-
Set Plesk Administrator password exactly the same as on the crashed server by using steps from this article:
How to retrieve/reset password of Plesk Administrator (admin) user in Plesk for Windows?
If you have any issues with resetting a password by using this command, restore MySQL password for the
admin
user according to the following article: -
Restore MSSQL password for the
sa
user via MSSQL Management Studio . -
Reconfigure MSSQL Webadmin by executing these commands one by one:
C:\> "%plesk_cli%/repair" --reconfigure-mssql-webadmin-site
C:\> "%plesk_cli%/repair" --update-mssql-users-permissions
-
Find and rename/delete all
.Security
files in thevhosts
folders:C:\> for /F "skip=1 usebackq" %r in (`plesk db -e "select name from domains"`) do move "%plesk_vhosts%"\%r\.plesk\.Security "%plesk_vhosts%"\%r\.plesk\.Security.old
-
Reset passwords for all Plesk entities by using steps from this article:
-
Back to the Command Line Console and create all system usersby executing these commands:
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 -
Run Plesk Reconfigurator, click the Repair Plesk Installation button, mark the Plesk Virtual Hosts security checkbox only and click the Check button in order to recreate systems users and restore their permissions:
-
Go to Tools & Settings > Server components > and click Refresh Server Components
-
Back to the Command Line Console and repair SSL certificates:
C:\> plesk repair web -sslcerts
-
Recreate domains in IIS Web server by executing these commands:
C:\> plesk repair web -y
-
Reconfigure FTP by running this command:
C:\> plesk repair ftp -y
-
Reconfigure Mail server by launching this command:
C:\> plesk repair mail -y
Note: in case of issues with the Horde webmail reinstall it.
-
Run the command below to update DNS zones:
C:\> plesk repair dns -y
-
Copy SmarterMail content:
From:
CONFIG_TEXT: D:\SmarterMail
To:
CONFIG_TEXT: C:\SmarterMail
-
Stop all Plesk services in Plesk Services Monitor:
-
Copy Web Prescense Builder configuration and websites:
D:\Program Files (x86)\Plesk\sb\config
toC:\Program Files (x86)\Plesk\sb\config
.D:\Program Files (x86)\Plesk\sb\sites
toC:\Program Files (x86)\Plesk\sb\sites
-
Copy applications cache
D:\Program Files (x86)\Plesk\var\apspackages
intoC:\Program Files (x86)\Plesk\var\apspackages
. -
Copy Horde DB password from
D:\Program Files (x86)\Plesk\Webmail\horde\conf\.horde.shadow
toC:\Program Files (x86)\Plesk\Webmail\horde\conf\.horde.shadow
. -
Copy Plesk databases:
MySQL - copy
D:\Program Files (x86)\Plesk\MySQL\Data
toC:\Program Files (x86)\Plesk\MySQL\Data
MSSQL - copyD:\Program Files (x86)\Plesk\Databases\MSSQL\MSSQL.1\MSSQL\Data
toC:\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. -
Copy content from
D:\Inetpub\vhosts
toC:\Inetpub\vhosts
. -
Copy mail content:
MailEnable Server -
D:\Plesk\Mail Servers\Mail Enable
, folders Config , Postoffices , Queues .SmarterMail Server - copy
D:\SmarterMail
toC:\SmarterMail
with content only at the end of this instruction. -
Copy Databases from
D:\Program Files (x86)\Plesk\Databases\MySQL
toC:\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. -
Copy certificates from
D:\Program Files (x86)\Plesk\var\certificates
toC:\Program Files (x86)\Plesk\var\certificates
. -
Start Plesk services in Plesk Services Monitor
-
Set Administrator password in cmd exactly the same as on crashed server:
C:\> "%plesk_bin%\plesksrvclient.exe" -set setup
-
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 -
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
-
Open Windows Registry and load D:\Windows\System32\config\SOFTWARE hive according to Load or Unload Registry Hives.
ExportNEW_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. -
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 -
Run
Plesk Reconfigurator
and perform Repair Plesk Installation > Plesk Virtual Hosts security - it recreates systems users and restores permissions. -
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 -
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
-
Reconfigure Mail server:
C:\> "%plesk_bin%\mchk.exe" --all --fix=all
Note: In case of Webmail issues please reinstall
Horde
-
Update DNS zones:
C:\> "%plesk_bin%\dnsmng.exe" update *
-
Copy SmarterMail content if required.
Comments
0 comments
Please sign in to leave a comment.