Friday, August 14, 2009

Sharepoint Site backup/archiving/cloning/moving

While there are many ways in SharePoint to save/archive/backup/ an existing site and its subsites such as save as a template, part of a backup, or the new move/merge site option on Sharepoint Administration, one of the most flexable and sure method for the save/archive/backup is the 'export' option to 'stsadm.exe' found in the 12 hive's bin directory. Its couterpart the 'import' option fullfills the clone/move function.

The export option can export whole site collections. When doing sitecollections or sites with large files then increase the compressed file size with the'-cabsize NNNN' option.
On export operations set the '-Versions N' where 4 is most useful value for full backup and archive.
For clone operations '1' or '2' is probably the most efficient value depending on your library version settings. See the Reference section below.

The real beauty of this export is that not only includes contents but also the SD (designer) workflows. The worklows may have broken links on an import to a new site name but are easly fixed. At least they are there, unlike 'site templates'.

Since an exported site's contents can be imported on top of an existing site's contents, one gets the 'merge' operation. For this it is important that the -UpdateVersions option be set to '1' which adds them ias a new version where a list item or document exists, otherwise it is an error.

There are some cleanup things that should
Before doing an export for clone/archiving/move purposes one should take the time to:
  • delete all unnecessary copies of forms, datasources, et al created with SP Designer
  • if exporting a site collection retract and/or delete any unneeded solutions
  • empty all the recycle bins for all sites involved, both levels on site collection if enabled
  • for a clone/merge operations all unnecessary versions of list and documents should be deleted

On the export command it would be prudent to always include security in case its is reloaded from backup/archive. One can still chose to incude or igore the security on the import.

If one is doing a clone operation, E.G. creating a new department or office site then the security should NOT be included on the import command unless all sites should have equal access.

This abitlity to add content to an emtpy but pre-existing site is important when it is desired that the visibitly of the 'Top Link Bar' tabs and 'Quick Launch content be controlled by the user's role permissions. Manually created links are visible to all. Therefore, to get the default response one should create a blank site with the desired name using the browser tools and then do an import to this same site. Dependimng on your circumstances site Titles may have to edited unless you updated a pre-existing site.

References:

>stsadm -help export
stsadm.exe -o export -url

-filename [-overwrite] [-nologfile] [-quiet]

[-includeusersecurity] [-haltonwarning] [-haltonfatalerror]

[-cabsize

[-versions <1-4>

1 - Last major version for files and list items (default)

2 - The current version, either the last major or the last minor

3 - Last major and last minor version for files and list items

4 - All versions for files and list items]

>stsadm -help import
stsadm.exe -o import -url

-filename [-nologfile] [-quiet] [-haltonwarning]

[-includeusersecurity] [-nofilecompression] [-haltonfatalerror]

[-updateversions <1-3>

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]

stsadm -o export -url http://server/sites/abc -filename .\savefile -includeusersecurity

-nologfile -versions 2

stsadm -o import -url http://server/sites/ghi -filename .\savefile -nologfile -versions 1

Happy site management.

No comments:

Post a Comment