Here is an example for that :
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint.Deployment;
SPExportSettings exportSettings = new SPExportSettings();
exportSettings.SiteUrl = "http://oldwebsite";
exportSettings.ExportMethod = SPExportMethodType.ExportAll;
exportSettings.BaseFileName = "exportfile";
exportSettings.FileLocation = "c:\\";
SPExport export = new SPExport(exportSettings);
Export.Run();
SPImportSettings importSettings = new SPImportSettings;
importSettings.BaseFileName = "exportfile";
importSettings.FileLocation = "c:\\";
importSettings.SiteUrl = "http://newwebsite";
SPImport import = new SPImport(importSettings);
Import.Run();
No comments:
Post a Comment