Hi
I create a web with webpart page, on wich all webparts are connected and some web parts represents lists on this web.
I need to transfere this web to another server (but only this page).
This code supose to do a trick but it's not working correctly (and no error apears).
This code is importing web site, but not to http://wssdemo-os:85/test
but http://wssdemo-os:85
I create a web with webpart page, on wich all webparts are connected and some web parts represents lists on this web.
I need to transfere this web to another server (but only this page).
This code supose to do a trick but it's not working correctly (and no error apears).
This code is importing web site, but not to http://wssdemo-os:85/test
but http://wssdemo-os:85
static void Main(string[] args) { export(); import(); } static void export() { SPSite site = new SPSite("http://wssdemo-os:82"); SPWeb web = site.RootWeb; SPExportObject exportObject = new SPExportObject(); exportObject.Id = web.ID; exportObject.IncludeDescendants = SPIncludeDescendants.All; exportObject.Type = SPDeploymentObjectType.Web; SPExportSettings settings = new SPExportSettings(); settings.SiteUrl = "http://wssdemo-os:82"; settings.ExportMethod = SPExportMethodType.ExportAll; settings.FileLocation = @"c:\export"; settings.FileCompression = true; settings.ExcludeDependencies = false; settings.BaseFileName = "exportfile.cmp"; settings.ExportObjects.Add(exportobj); SPExport export = new SPExport(settings); export.Run(); web.Dispose(); site.Dispose(); } static void import() { SPImportSettings settings = new SPImportSettings(); settings.SiteUrl = "http://wssdemo-os:85"; settings.WebUrl = "http://wssdemo-os:85/test"; settings.FileLocation = @"c:\export"; settings.FileCompression = true; settings.BaseFileName = "exportfile.cmp"; settings.RetainObjectIdentity = true; SPImport import = new SPImport(settings); import.Run(); }