Question

Is there any other ways of exporting a sites as solution in SharePoint Foundation 2010 except through "Site Settings -> Site Actions -> Save Site as Template"?
Seems to be the only way, just to make sure I'm not missing anything (through the designer probably? There's an option in the designer, but it brings you to the same "Save Site as Template" page)

Thanks!

Was it helpful?

Solution

In the out-of-the-box UI that's the only place to export a site, but note that unlike sp2007 this now export your site as a wsp-package

In the object model there are a couple of ways to export the site:

  • SPWeb.SaveAsTemplage
  • SPSolutionExporter.ExportWebToGallery
  • SPSolutionExporter.ExportWeb

OTHER TIPS

AS part of Microsoft Course 10325A - Windows PowerShell 2.0 - backup / restore site collections.

PowerShell creates Cabinet files or .CAB files - http://en.wikipedia.org/wiki/Cabinet_(file_format). One nice thing about PowerShell is automation and you can easily perform the same task as you would via SharePoint 2010 Central Administration, in the Backup and Restore section.

Being scripted, you can provide any extension for your backup file. Extract and View the archive contents and modify, using "Extract.exe", provided with early versions of Windows and replaced in XP with "Expand.exe".

Rebuilding modified CAB files, is achieved with "MakeCab.exe", the Microsoft Cabinet SDK "CabArc.EXE" or any application supporting "application/vnd.ms-cab-compressed".

To restore a site collection using Windows Power Shell, from the Start menu, All Programs > Microsoft SharePoint 2010 Products.

Open SharePoint 2010 Management Shell (launch with Administrator rights, if required by right click and choosing "Run as Administrator").

Backup-SPConfigurationDatabase
Backup-SPFarm
Backup-SPSite
Get-SPBackupHistory
Restore-SPFarm
Restore-SPSite

The most fitting to your requirement;

Backup-SPSite
Restore-SPSite

Backup-SPSite http://server_name/sites/site_name -Path C:\Backup\site_name.bak
Restore-SPSite http://server_name/sites/site_name -Path C:\Backup\site_name.bak

Great book filled with automation scripting with PowerShell, the book by Gary Lapointe - Automating Microsoft SharePoint 2010 Administration with Windows PowerShell 2.0

.Net namespace for C# code within PowerShell or PowerShell within.Net applications;

Microsoft.SharePoint.Publishing.Administration

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top