STSADM is a SharePoint administration command-line tool with many operations, including backup and restore of an entire SharePoint installation or only a subsite.
We will back up and restore SharePoint from the command line using stsadm.exe
Backing up SharePoint using stsadm -o backup
- stsadm.exe -o setsitelock -url http://vassharepoint -lock noaccess – Locks SharePoint before the backup
- stsadm.exe -o backup -url http://vassharepoint -filename H:\Backup\Sharepoint.dat -overwrite – This backs up SharePoint at http://vassharepoint to H:\Backup\Sharepoint.dat
Backing up SharePoint using stsadm -o export
- stsadm.exe -o setsitelock -url http://vassharepoint -lock noaccess – Locks SharePoint before the backup
- stsadm.exe -o export -url http://vassharepoint/subsite -filename H:\Backup\Export.cab -includeusersecurity -versions 4 -overwrite – Exports the selected SharePoint site to H:\Backup\Export.cab
– versions 4 – exports all versions of each file
– includeusersecurity – exports user permissions
During backup, stsadm -o export creates CAB files of approximately 25 MB. I recommend exporting to a directory and copying the entire directory when transferring the export to another server
Restoring SharePoint using: stsadm -o restore
- stsadm.exe -o restore -url http://vassharepoint -filename H:\Backup\Sharepoint.dat -overwrite – This restores SharePoint at http://vassharepoint from H:\Backup\Sharepoint.dat
- stsadm.exe -o setsitelock -url http://vassharepoint -lock none – Unlocks the restored SharePoint site
Restoring SharePoint using stsadm -o import
Importing subsite data to the root level is not recommended
- stsadm.exe -o import -url http://vassharepoint/subsite -filename H:\Backup\Export.cab -includeusersecurity -overwrite – Imports the selected SharePoint site from H:\Backup\Export.cab
- stsadm.exe -o setsitelock -url http://vassharepoint -lock none – Unlocks the restored SharePoint site
Komentáře