将一个站点移动到另一个子站点(move one subsite to other subsite)

  1. 命令行

stsadm -o export -url http://Server:port/BBB/BBB1 -includeusersecurity -filename d:\test.cmp

把BBB站点下的BBB1子站点导出
stsadm -o import -url http://Server:port/IT/BBB1 -includeusersecurity -filename d:\test.cmp

把上面导出的子站点导入到IT子站点下,形成新的子站点。

  1. MOSS对象模型
    1. Export
            SPExportSettings spExportSettings = new SPExportSettings();
            spExportSettings.AutoGenerateDataFileName = true;
            spExportSettings.ExportMethod = SPExportMethodType.ExportAll;
            spExportSettings.SiteUrl = " http://Server:port/BBB/BBB1";
            spExportSettings.IncludeSecurity = SPIncludeSecurity.All;
            spExportSettings.IncludeVersions = SPIncludeVersions.All;
            SPExport spExport = new SPExport(spExportSettings);
            spExport.Run();
    1. Import

            SPImportSettings spImportSettings = new SPImportSettings();
            spImportSettings.BaseFileName = Path.GetFileName("生成的文件全路径");
            spImportSettings.FileLocation = Path.GetDirectoryName("生成的文件全路径");
            spImportSettings.SiteUrl = "http://Server:port/IT/BBB1";
            spImportSettings.RetainObjectIdentity = false;
            spImportSettings.IncludeSecurity = SPIncludeSecurity.All;
            spImportSettings.UpdateVersions = SPUpdateVersions.Append;
            spImportSettings.UserInfoDateTime = SPImportUserInfoDateTimeOption.ImportAll;
            SPImport import = new SPImport(spImportSettings);
            import.Run();

你可能感兴趣的:(move)