The STSADM tool allows you to import and export SharePoint sites by specifying STSADM -0 Import and STSADM -o Export. The Import/Export options are ideal for backing up and restoring subwebs. To backup and restore entire site collections use STSADM -o Backup and STSADM -o Restore options.
Let’s say you want to backup a Demo subsite at http://www.seattlepro.com/demos and restore it to a different site at http://www.techgalaxy.net/demos. You can use the following method to export the demo site and then restore it to the intended destination. If you want to preserve permissions use the -includeusersecurity switch.
First, make sure STSADM is on your path so you can run it from any directory you want. Otherwise, run it from its default location at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN.
To export the subsite use the following syntax at the Command Prompt. Open the Command Prompt on the SharePoint server as an administrator if necessary.
C:\>stsadm -o export -url http://www.seattlepro.com/demos -filename DemoSiteBackup -includeusersecurity
You will see a single file called DemoSiteBackp.cmp that includes the exported content. You will also see a log file called DemoSiteBackup.export.log.
TIP: Just to make things easier, you might want to create a folder, like C:\SPBackups. Run the STSADM from that folder so the export file (DemoSiteBackup.cmp in our example) and the log file will be created in the same folder.
Now to import the subsite to a different site use the following syntax at the Command Prompt. Open the Command Prompt on the SharePoint server as an administrator if necessary.
C:\>stsadm -o import -url http://www.techgalaxy.net/demos -filename DemoSiteBackup.cmp -includeusersecurity
Notice that this time you need to provide the filename extension, which is .cmp. You should see the Demo site show up as a subsite in the destination site after the script has been successfully executed. You will also see a log file called DemoSiteBackup.cmp.import.log.
If you need to explore other import or export options, type stsadm -help import or stsadm -help export to see the complete syntax. For example:
C:\>stsadm -help importstsadm.exe -o import-url <URL to import to>
-filename <import file name>
1 - Add new versions to the current file (default)
2 - Overwrite the file and all its versions (delete then insert)
3 - Ignore the file if it exists on the destination]
Copyright © 2013 Zubair Alexander. All rights reserved.
|« Jan||Mar »|
24 queries. 0.471 seconds