If you want to move your SharePoint site set from the test server to the production server, there are multiple methods to achieve this based on the information on the Internet, here I tested the use of stsadm for moving (this method does not seem to be recommended by Microsoft, especially when moving across farm, there will be problems, but here we only operate on different servers of the same farm, so the problem is not big. In fact, we mentioned that "Mobile moving" should be operated in the same farm environment, for cross-farm operations, the correct syntax should be migration/updating ). The procedure is described below.
Step 1. Use the stsadm command to back up the website collection on the testing server
Before using this command, you can refer to my other note
SharePoint [Study Notes] -- add stsadm In Path)
The stsadm Command Used for backup is as follows:
Stsadm-O backup-URL http: // <server name >:< port>-filename <path \ name to be used for the backup file>
Example:
Tsadm-O backup-URL http: // your point2010: 6666-FILENAME "E: \ backup6666.bak"
Http: // sharepoint2010: 6666 is the website collection you want to back up. If the backup operation is completed successfully, "Operation completed successfully" is displayed"
You can directly use this command to create a backupmysp2010.bat file under c: \ of the testing server. The Code is as follows:
@ Echo off
@ Echo ---------------
@ Echo this script will backup your site: [http: // sharepoint2010: 6666]
@ Echo ---------------
Cd c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ bin
@ Echo locking site collection before the backup process starts
@ Echo off
Stsadm-O getsitelock-URL http: // sharepoint2010: 6666
Stsadm-O setsitelock-URL http: // sharepoint2010: 6666-lock readonly
@ Echo site collection is now locked
@ Echo logic to create a new file name daily
@ Echo off
Stsadm.exe-O backup-URL http: // sharepoint2010: 6666-filename D: \ spbackup \ mysp2010backup. dat-overwrite
@ Echo backup completed
@ Echo please get backup file in folder filename D: \ spbackup \ mysp2010backup \ mysp2010backup. dat
@ Echo off
Stsadm-O setsitelock-URL http: // sharepoint2010: 6666-lock none
@ Echo site lock removed
Cd c :\
The website collection backup operation is completed by running this file.
Step 2. Create a server on the production serverThe Web application is used to run the website set to be restored.
Go to the production server SharePoint Central Administration> Application Management> under SharePoint Web Application Management> Click Create or extend web application. enter the required information, and click OK to wait until the web application creation command is executed.
Step 3. After the web application is successfully created, run stsadm to restore the website collection we have previously backed up.
1. copy the website collection file D: \ spbackup \ mysp2010backup \ mysp2010backup on the testing server. copy dat to the specified directory on the production machine (of course, if the two machines are shared, you can also directly access the network to save this step). In this example, copy the DAT to the Directory D of the production machine: \ spbackup \ mysp2010restore \
2. Run the following stsadm command to restore the backup website set:
Stsadm-O restore-URL http: // <server >:< port>-filename <path \ Name of the Backup File>
Example:
Stsadm-O restore-URL http: // sharepoint2010: 6666-FILENAME "D: \ spbackup \ mysp2010restore \ mysp2010backup. dat"
In this step, I still use the restoremysp2010.bat command file. The Code content is as follows:
@ Echo off
@ Echo ---------------
@ Echo this script will restore your site: [http: // sharepoint2010: 6666]
@ Echo ---------------
Cd c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ bin
@ Echo locking site collection before the backup process starts
@ Echo off
Stsadm-O getsitelock-URL http: // sharepoint2010: 6666
Stsadm-O setsitelock-URL http: // sharepoint2010: 6666-lock readonly
@ Echo site collection is now locked
@ Echo off
Stsadm.exe-O restore-URL http: // sharepoint2010: 6666-filename D: \ spbackup \ mysp2010restore \ mysp2010backup. dat
@ Echo restore completed
@ Echo the backup file is from folder D: \ spbackup \ mysp2010restore \ mysp2010backup. dat
@ Echo off
Stsadm-O setsitelock-URL http: // sharepoint2010: 6666-lock none
@ Echo site lock removed
Cd c :\
Directly execute this file to automatically restore the website collection.
Step 4. if the restoration fails, or you encounter some strange error messages when accessing the website after the restoration is complete, most of the reasons are that your original website set contains user-specific content or settings. In such cases, you only need to handle specific problems and deploy and operate different personalized content, to achieve the same personalized effect as the test server.
Next we will list the most common handling cases.
1. Deploy your solution (if any) to the production machine.
1.1 Use the stsadm command to deploy the user solution on the server farm first
Stsadm-O addsolution-filename <path to mysolution. WSP>
Example:
Stsadm-O addsolution-FILENAME "D: \ sp1devshare \ solution \ bin \ debug \ mysolution. WSP"
If this solution has been deployed, you must delete it before deploying it. The DELETE command is
Stsadm-O deletesolution-name "mysolution. WSP"-override
1.2Then, use the stsadm command to deploy solution to the web collection recovered before the user.
Stsadm-O deploysolution-name mysolution. Internet. Test. WSP-URL <site>-immediate-allowgacdeployment-allowcaspolicies
Example:
Stsadm-O deploysolution-name starmaidspsolutions. WSP-URL http: // sharepoint2010: 6666-allowgacdeployment-immediate
In this step, you can also use system settings à farm management à manage farm solution of the SharePoint management center to complete the operation. The operating procedure is: select the solution to be deployed, and click the 'ploy' button on the top, select the web application to be deployed and click OK. Then the Management Center starts to perform your deployment operations, which may take several minutes. After this process is completed, remember to restart IIS to make the deployment take effect immediately.
2. Make sure that all asssemblies (DLL) used by your mobile web collection are also stored in the GAC (Global Assembly Cache) of the production machine.
GAC is usually located in the c: \ windows \ Assembly directory.
3. Activate features involved in user solution.
In the newly deployed web collection, site actions à site settings à site collection features à
Click the activate button to activate the site collection features.
4. Update the Web. config file
When adding DLLs for your solution, we need to modify web. config so that they can be registered as secure contol (Safe controls ). Some other settings may need to be modified in Web. config (assemblybindings, pageparserpaths and keys ). This file may cause many strange errors to occur in the newly transplanted website collection. We usually enable the web of this website collection on both the production machine and the test machine. config File, compare the two, and then use the web. config File, use copy/paste on the production machine web. complete the missing settings in the config file.
Web. config can be found in the following path: <drive letter >:\ Inetpub \ wwwroot \ WSS \ virtualdirectories \ <port number> \ WEB. config
Example: C: \ Inetpub \ wwwroot \ WSS \ virtualdirectories \ 6666 \ WEB. config
Generally, after this step is completed, the newly transplanted website collection can be run on the production server.