Important notice

Please note that this blog is discontinued here. All the posts are also coppied to my new blog at http://boris.gomiunik.net.
Important: Due to large amount of comment spam further commenting has been disabled here. If you wish to send me a comment, plase look up the same post on my new blog and leave comment there. Thanks!

1/23/2008

Backup, restore and migration of sites on SharePoint 3 pt. 3/3

stsadm -o export and stsadm -o import

To backup:
1. Locate stsadm.exe
2. in Command prompt type stsadm -o export -url http://[url-of-the-web-site-or-subsite] -filename [path and name of the file.dat]

To restore:
1. Create a web application and a site collection using sharepoint central administration. Or you can create a subweb in an existing site collection. In both cases you should use a "Blank site" template.
2. Locate stsadm.exe
3. In Command prompt type stsadm -o import -url http://[url-of-the-web-site-or-subsite] -filename [path and name of the file.dat]

You've probably noticed a difference from a method described n previous post is small (only export and import instead of backup and restore). Also we can see that the order of parameters and their values isn't important.

PROS:
1. You can export (migrate) a subsite
2. If you include parameter -includeusersecurity it keeps the security settings and owner information
3. It doesn't keep the list and sites GUIDs so you can use it to copy a site collection inside of the same content database.

CONS:
1. You need access to the server to run the stsadm.exe
2. It doesn't keep the SharePoint Designer's Data-View-Webparts (again you have to fix them manually - read more about it here.)
3. You loose the meta data (created and modified dates and who created it) by default.

7 comments:

Anonymous said...

Stsadm export/import also doesn't retain list view web part's properties correctly. It does render the web part but the selected view will be wrong.

Boris Gomiunik said...

Thanks for the message! It's true, it doesn't render the list view web parts correctly. But this looks like an issue with SharePoint, because if you save the site like template and restore it, it makes the same error.

Any list view web parts are returned to their default views.

Peter Norbaum said...

Thank you for this short step-by-step guide on a quick backup/restore of a Sharepoint site. Yet another important thing to think about when you backup/restore something is security. That's especially important when backing up sites or site collections on MOSS 2007 since the level-permission security implemented within it. However it's not possible to manage security on a granular level using basic security management in sharepoint administration. For such a large object as site I find it more effective to my needs to backup security separately from data. I use Scriptlogic Security Explorer for that. Using it I can then restore just that security settings that I need. For example I can restore only Design permissions or configure security so that I filter our ACLs that are no longer effective on the environment. Sometimes someone who had a specific access permission on a site leaves or there's no need for him to have access. With Security Explorer I can securely clean out orphaned security settings and configure security settings for a site I've restored based on a security settings I have for another site. I can just select an object and copy its permissions propagating to this restored site. Thanks to the level of security management details that allows me to restore security down to the item level. What's cools is that since MOSS runs over the SQL Server 2005 and Security Explorer supports managing security on SQL server I can even further tune security by configuring it on SQL objects within a database. Another thing that I like is cloning feature. I can take a master-user and then create other users and apply their access permissions based on access permissions implemented for this user. Another thing with backing up MOSS is that when you backup a site you don't backup setting for your shared services and application settings.

Anonymous said...

This solved the problem I've been trying to fix all morning. Thanks fo much for posting this solution.

sep23 said...

Thanks a bunch. I can't tell you how my gyrations I went through over the last couple days. I can't believe MS sites don't have better instructions like this.
Anyways I overcame one hurdle now let's see what else I run into.
Trying to work with customized solutions too.

quangvo said...

thanks this is really great, i also try to follow this backup guide (http://connectionstringexamples.com/article.php?story=20080513003320288) when working with your guide excellent thanks.

quangvo said...

thanks this is really great, i also try to follow this backup guide (http://connectionstringexamples.com/article.php?story=20080513003320288) when working with your guide excellent thanks.