Instructions for upgrading win2003 and win2008 to win2012, retaining data, reinstalling, and restoring data.
Published: 2018-06-14
Please note: This tutorial is only applicable to the preinstalled environment of our company's Website Management Assistant and to users who have a certain understanding of the server environment. Please read this description carefully before reinstalling, and then handle it according to the actual situation. If there are important files on the C drive (Desktop), please copy and back them up to the D drive in advance. If you want to upgrade to win2016, you can refer to: https://www.west.cn/faq/list.asp?unid=2446
There are two cases:
① The server uses a sqlserver database.First handle it according to Step 1 in this article.
② The server does not use a sqlserver database. Skip Step 1. You can directly reinstall with data retained to: Win2012 preinstalled Website Building Assistant MSSQL2012 Then start processing according to 2.1 in Step 2.
Step 1. A sqlserver database is installed.
For environments not provided by our company,for manually created databases, please back up the data yourself in advance, such as copying and backing up the mdf and ldf files, backing up and exporting as bak files, etc.
After backing up, you can refer to the steps in 1.2 to handle directory permissions, then use the Management Assistant to recreate the database and restore it with the backed-up bak file.
Our company's preinstalled environment
1.1) Please back up all databases in mssql as shown in the figure, and note to save them to the D:\mssql directory. For environments not provided by our company, please export them to the D drive yourself so that they can be used for recovery if problems occur.

1.2) After the backup is successful, choose to reinstall with data retained to Win2012 preinstalled Website Building Assistant MSSQL2012 .
windows2012+sql2012 database recovery:
Manually download
http://download.myhostadmin.net/数据库软件/sqlserver2012/2012-d/Program%20Files%20(x86).rar
http://download.myhostadmin.net/数据库软件/sqlserver2012/2012-d/Program%20Files.rar
http://download.myhostadmin.net/数据库软件/sqlserver2012/2012-d/mssql.rar
Save to the D drive, right-click -- select Extract to current folder

Open the cmd command line. To open it: enter C:\Windows\System32\cmd.exe in the computer address bar and press Enter.

Copy and execute the following commands in sequence:
cacls "D:\Program Files\Microsoft SQL Server" /e /g westmssql:f /T
cacls "D:\Program Files (x86)\Microsoft SQL Server" /e /g westmssql:f /T
cacls D:\mssql /e /g westmssql:f /T
sc config MSSQLSERVER start= auto
After resetting permissions, make a copy of d:\mssql and keep it. Then copy and execute to start the sqlserver service
net start MSSQLSERVER

1.3) Use the Website Building Management Assistant to synchronize the mssql database.
As shown in the figure, check the database and click the Sync button to synchronize the database. If there is an abnormality in the data of a certain database, you can use the Management Assistant to restore the backup exported in Step 1.1.

1.4) After the mssql database synchronization is completed, open and edit the database, then click the "Repair" button to repair the database owner.

Then follow steps 2.1) and 2.2) in Step 2 to redeploy the php environment and restore the website through the Website Building Management Assistant.
Step 2. Website data recovery.
2.1) Open the Management Assistant and click Environment Detection. Check the required environment as needed (Important: do not check mysql for now).

2.1.1) mysql database processing
Steps if the original version was mysql5.6:
Open the cmd command line and enter and execute in sequence:
cacls D:\SOFT_PHP_PACKAGE\mysql5.6 /e /g mysql:f /T
net start mysql56

For mysql5.1 version, follow the steps below:
The original win2003 and win2008 default mysql is version 5.1, and the reinstalled win2012 default is the mysql5.6 service. Therefore, if mysql5.1 was used before, you need to reinstall mysql. The steps are as follows:
① Rename this directory D:\SOFT_PHP_PACKAGE\mysql to mysql_bak.
② Use the Management Assistant to reinstall mysql5.1

After installation is complete, open the command line, enter cmd and press Enter, then enter net stop mysql to stop the mysql service

Copy the D:\SOFT_PHP_PACKAGE\mysql_bak\data directory to replace D:\SOFT_PHP_PACKAGE\mysql\data
Execute the following commands in the command line window
cacls D:\SOFT_PHP_PACKAGE\mysql /e /g mysql:f /T
sc config mysql start= auto
net start mysql
This step resets the mysql directory permissions and starts the mysql service.
Open the Management Assistant, click System Settings -- Global Parameters and then click "Try to Crack" to reset the mysql root password.

2.2) Site recovery.
For the recovery of sites and mysql users, please refer to: https://www.west.cn/faq/list.asp?unid=608
If a site has permission issues, edit the site separately, check "Reset Permissions", and then save the edit.

After the above operations are completed, test accessing the site to see whether it can be accessed normally. If there is no problem with access, it means the migration has been completed.
Reminder again: This operation method is only for use in our company's preinstalled environment. If problems occur during the operation steps, please submit a ticket in time and we will help you verify.
