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 our company's Website Management Assistant pre-installed environment and users who have a certain understanding of the server environment. Before reinstalling, please read this instruction carefully, 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 win2016, you can refer to:https://www.west.cn/faq/list.asp?unid=2446
There are two cases:
①. The server uses the sqlserver database.First follow Step 1 in this article.
②. The server does not use the sqlserver database. Skip Step 1. You can directly reinstall while retaining data to: Win2012 pre-installed Website Building Assistant MSSQL2012 then start processing from 2.1 of Step 2.
Step 1. SQL Server database is installed.
For environments not from our company,for manually created databases, please back up the data yourself in advance, for example, copy and back up the mdf and ldf files, export a backup as a bak file, etc.
After backup, you can refer to the steps in 1.2 to handle directory permissions, then use the Management Assistant to recreate the database, and restore and recover with the backup bak file.
Our company's pre-installed environment
1.1) Please back up all databases in mssql as shown in the figure. Note to save them to the D:\mssql directory. If it is not our company's environment, 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 retain data and reinstall to Win2012 pre-installed Website Building Assistant MSSQL2012 .
windows2012+sql2012 Database recovery:
Manual 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. How to open: enter C:\Windows\System32\cmd.exe in the computer address bar and press Enter to open it.

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 database, you can use the Management Assistant to restore the backup exported in Step 1.1.

1.4) After the mssql database synchronization is complete, open Edit Database, then click the "Repair" button to repair the database owner.

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

2.1.1) mysql database handling
Steps for the original mysql5.6 version:
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, operate as follows:
The original win2003 and win2008 default mysql is version 5.1, and the reinstalled win2012 defaults to 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 and replace the D:\SOFT_PHP_PACKAGE\mysql_bak\data directory to 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 is to reset the mysql directory permissions and start the mysql service.
Open the Management Assistant, click System Settings -- Global Parameters then click "Try to Crack" to reset the mysql root password.

2.2) Site recovery.
For site and mysql user recovery, 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 are no access problems, it means the migration has been completed.
Reminder again: This operation method is only for use in our company's pre-installed environment. If problems occur during the operation steps, please provide feedback via a ticket in a timely manner and we will help you verify.
