The purpose is to restore the migration of a sub-site to the first important site. The script of stsadm.exe is used for backup and restoration. Made a BAT file,
The backup script is as follows:
"C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ bin \ stsadm.exe"-O backup-URL http: // site-filename backup. dat-overwrite
Pause
The restore script is as follows:
"C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ bin \ stsadm.exe"-O restore-URL http: // othersite-filename backup. dat
Pause
After testing, this is dedicated to backup and restore the primary website (top-level website), and the effect is very good. Of course, the self-developed control also needs to be manually copied to the corresponding location.
Import and export are used for Backup Recovery of sub-websites. The backup script is as follows:
"C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ bin \ stsadm.exe"-O import-URL http: // site/TT/-filename backup. dat
Pause
Restore:
"C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ bin \ stsadm.exe"-O export-URL http: // othersite/TT/-filename backup. dat-overwrite
Pause
Because the master page is in the primary website, you may need to manually restore the primary website.
However, none of the above scripts can meet the requirements for restoring a sub-website to a primary website. Finally, I found a smigrate in SharePoint 2003 on the Internet. it is said that EXE can solve this problem, because sharepoint2007 does not exist, and an smigrate is posted on the Microsoft official website. EXE. The backup script is as follows:
Smigrate.exe-y-W http: // sites/00-F backup. fwp-U [domain \ usename]-PW [Password]
Pause
An empty website must be created before restoration. The website creation and restoration scripts are as follows:
Code
"C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ bin \ stsadm.exe"-O createsite-URL http: // othersite: 9090-ownerlogin [domain \ loginname]-owneremail someone@example.com
Smigrate.exe-r-W http: // othersite: 9090-F backup. fwp-U [domain \ loginname]-PW [Password]
Pause
However, after use, we found that this is not easy for Sharepoint 2007. Although it can be backed up and restored, it has lost a lot of things and reported errors everywhere ...... I don't know if it is a problem with my empty website script. Finally, I had to give up. Restore manually.