Use stsadm.exe to back up and restore a Sharepoint website

Source: Internet
Author: User

I. Process description:

First, use stsadm.exe to back up the website set on the source site machine, copy the backup file to the target server (you can also directly configure the backup path as the target machine path during Backup), and then perform the Restoration Operation: first, create a new site set. Then, use the stsadm.exe tool of sharepointto restore the site. copy sp. the DLL required by the listview control and the Web. config configuration file. The procedure is as follows. In this example, the SharePoint site is backed up from the server 192.168.10.59 and then restored to 192.168.11.31.

Ii. Steps

1. Back up the SharePoint site.

Create the backupsite. BAT file on 192.168.10.59 with the following content:

Stsadm.exe-O backup-URL %-filename % backpath %-overwrite
Cd c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ bin
Stsadm.exe-O backup-URL http: // 192.168.10.59: 80-filename c: \ backup \ fudeng_home.bak-overwrite

 

Double-click the BAT file. After the command is executed, continue to the next step.

Note: Make sure you have the write permission on the c: \ backup folder.

2. Restore A SharePoint site

(1) create a restoresite. BAT file on 192.168.11.31. The content is as follows:

Iisreset/stop

Cd c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ bin

Stsadm.exe-O restore-URL http: // 192.168.11.31: 80-filename c: \ backup \ fudeng_home.bak-overwrite

Iisreset/start 

Note: "iisreset/Stop" and "iisreset/start" are required commands, otherwise errors may occur during restoration.

 

(2) Before executing the BAT file, you need to create a new Web application.ProgramAnd website set.

Open the SharePoint management center and click Application Management]

 

Click new or expand application in the SharePoint web management bar]

After filling in the preceding configuration, click OK and click Create website set]

Fill in the following figure and click OK]

Run the restoresite. BAT file after the prompt is displayed.

 

After executing the restoresite. BAT file, it is a long wait. Stsadm needs to parse the Bak file, and then store the parsed content to the SharePoint content database. There is a large amount of network traffic between them, after direct connection between application servers and database servers, the restoration speed has been significantly improved. When configuring direct connection, make sure to change the database connection to the direct connection IP address on SharePoint.

 

3. After the site is restored, copy the DLL required by the SP. listview control and modify the Web. config configuration file.

The sp. listview control is used on our website. to continue using the control, you need to perform the following operations:

 

First, set \ 192.168.10.59 \ C $ \ Inetpub \ wwwroot \ WSS \ virtualdirectories \ 80 \ _ app_bin
Copy sp. listviewer. dll under the directory to the C: \ WINDOWS \ assembly and C: \ Inetpub \ wwwroot \ WSS \ virtualdirectories \ 80 \ _ app_bin directories.

 

Modify the Web. config file in the C: \ Inetpub \ wwwroot \ WSS \ virtualdirectories \ 80 directory and add <safecontrol Assembly = "sp. listviewer"
Namespace = "sp. listviewer" typename = "*"
Safe = "true"/>

Restart IIS

Iii. Backup and Restore. Bat full instance

Backup file. bat

 @ Echo back up fudengsharepoint Project @ echo off  Set   "  Oldpath = c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ bin  " Set   "  Url = http: // 192.168.10.59: 80  "  Set Timename = % Date :~ 0 , 4 % Date :~ 5 , 2 % Date :~ 8 , 2 % 0 % Time :~ 0 , 2 % Time :~3 , 2 % Time :~ 6 , 2 % Set   "  Backpath = c: \ backup \ fudeng _ % timename %. Bak  "  CD % Oldpath % @ Echo location: % Oldpath % @ Echo Project address: % URL % @ Echo backup path: % Backpath % @ Echo press any key to start the backup pause @ ECHO is in progress. Please wait a moment later. -O backup-URL %-filename % backpath %- Overwrite @ ECHO: Backup successful... pause 

Restore file. bat

 @ Echo restore fudeng SharePoint Project @ echo off  Set   "  Oldpath = c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 14 \ bin  "  Set   "  Url = http: // 192.168.11.31: 80  "  Set   " Restorefilepath = c: \ backup \ fudeng_201307080143641.bak  "  CD % Oldpath % @ Echo location: % Oldpath % @ Echo Project address: % URL % @ ECHO: % Restorefilepath % @ Echo press any key to start restoring pause @ ECHO is disabling iis... iisreset / Stop @ echo successfully closes iis... @ ECHO is restoring the website set... CD % Oldpath % Stsadm.exe -O restore-URL %-filename % restorefilepath % -Overwrite @ ECHO: the website set is restored successfully. @ ECHO: iisiisreset is enabled. /Start @ ECHO: iispause is enabled successfully. 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.