[Original] Instructions for upgrading win2003 and win2008 to win2016, preserving data, reinstalling, and restoring data

Published: 2021-09-03

Please note: This tutorial is only applicable to users of 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 description carefully first, 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.


Background:

windows2003, windows2008: Microsoft has long stopped providing update services. Currently, the system has many problems, the security risk is very high, and it is vulnerable to attacks. Related description: https://www.west.cn/news2/list.asp?newsid=830 


There are two situations:

①. The server uses a SQL Server database.First handle it according to Step 1 in this article.

②. The server does not use a SQL Server database. Skip Step 1. You can directly reinstall while retaining data as: 【Win2016 Pre-installed Website Building Assistant MSSQL2012】 Then start processing from 2.1 of Step 2.


Step 1. A SQL Server database is installed.

If the database was created manually, please back up the data yourself in advance, such as copying and backing up the mdf and ldf files, backing up and exporting them as bak files, etc.

After backing up, you can refer to step 1.2 to handle directory permissions, then use Management Assistant to recreate the database, and restore/recover using the backup bak file.


Steps for creating with Management Assistant are as follows

1.1) Please back up all databases in mssql as shown in the figure, and 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.

image.png

1.2) After the backup is successful, select reinstall while retaining data as 【Win2016 Pre-installed Website Building Assistant MSSQL2012】 .

windows2016+sql2012 database recovery:

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.

image.png

Execute the following commands in the command line:

cacls D:\mssql /e /g westmssql:f /T

sc config MSSQLSERVER start= auto

After the permissions are reset, make a copy of d:\mssql and keep it. Then copy and execute to start the SQL Server service.

net start MSSQLSERVER

image.png

1.3) Use 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 Management Assistant to restore the backup exported in step 1.1.

image.png

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

image.png

Then follow steps 2.1) and 2.2) in Step 2 to redeploy the php environment and restore sites through Website Building Management Assistant.


Step 2. Website data recovery.

2.1) Open Management Assistant and click Environment Detection. Check the required environment as needed (Important: do not check mysql for now).

image.png

2.1.1) mysql database handling

Steps if the original version was mysql5.6

image.png

Open Command Prompt and execute the following in the command line in sequence

cacls D:\SOFT_PHP_PACKAGE\mysql5.6 /e /g mysql:f /T 

net start mysql56

image.png

For mysql5.1 version, operate according to the following steps:

In the original win2003 and win2008, the default mysql is version 5.1; the reinstalled win2016 defaults to the mysql5.6 service. Therefore, if the previously default version used was not mysql5.6, you need to reinstall mysql. The steps are as follows:

①. Rename the directory D:\SOFT_PHP_PACKAGE\mysql to mysql_bak.

②. Use Management Assistant to reinstall mysql5.1

image.png

After installation is complete, find and open "Command Prompt" in Start, 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 is to reset the mysql directory permissions and start the mysql service.

Open Management Assistant, click System Settings -- Global Parameters  then click "Try to Crack" to reset the mysql root password.

image.png

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 problems, edit the site separately, check "Reset Permissions", and then save the edit.

image.png

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 pre-installed environment. If problems occur during the operation steps, please submit a ticket promptly and we will help you verify.