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/21/2008

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

stsadm -o backup and stsadm -o restore

To backup:
  1. On the server locate the file stsadm.exe (if you have sharepoint 2 and sharepoint 3 locate the one in the "12" folder.
  2. Open command prompt and type [path to stsadm.exe\]stsadm -o backup -url http://[url-of-the-web-site] -filename [path and name of the file.dat]

To restore: 
  1. Create a web application (but don't create a site collection)
  2. On the server locate stsadm.exe
  3. Open command prompt and type [path to stsadm.exe\]stsadm -o restore -filename [path and name of the file.dat] -url http://[url-of-the-web-site]

PROS:

It migrates the whole site collection perfectly! All data-view-webparts are preserved, all user rights, meta data, etc. are preserved).

CONS:
1, It keeps the same GUIDS of lists and sites, so you can't use it to create a copy of the site in the same content database. (Example: You have 1 web application and you want to create a copy of the site in the same site collection in the same web application)
2. You can't backup specific subsites - only entire site collection
3. You need to have access to the server to run stsadm.exe

8 comments:

Anonymous said...

Wow, spent three hours last night trying a variety of ways of restoring my database. Maybe I was just tired. Any how, ran this with my backup on a testbed system, and data restored perfectly.

Thanks!

Boris Gomiunik said...

Glad it worked out. I know the headaches we can have by backup/restore of sharepoint sites.

Anonymous said...

Backing up SharePoint sites can indeed be a headache. How about this one, restore fails if the backup file is marked as read only.

http://jritmeijer.spaces.live.com/blog/cns!8A48A27460FB898A!963.entry

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

You mentioned Con#1 which limits its use tremendously. Have you found a way around this or a different way of doing this without having to migrate the content by hand?

"so you can't use it to create a copy of the site in the same content database. (Example: You have 1 web application and you want to create a copy of the site in the same site collection in the same web application)"

Anonymous said...

Got it figured out.

stsadm -o Export and Import commands. Use the -cabsize switch with the Export command will create a file set to get around the 25meg cap.

*Make sure that your windows account has access within SharePoint to the site you are trying to Export and Import