none
MOSS 列表迁移 RRS feed

  • 问题

  • sharepoint 2007假设要将网站A中的列表list5迁移到子网站B中去(数据一起),如何实现?

    1.我试过使用另存为模版,但是容量超过了,没法实现,只能先将列表结构另存为模版,然后通过模版新建列表,代码读取写入到新的列表中去,效率不是很高

    2.使用SPExportSettings,SPImportSettings对象导入导出列表,出现错误。代码如下

         public void ExportContent(string sourseURL)
            {

                     SPExportObject exportObject = new SPExportObject();
                exportObject.Type = SPDeploymentObjectType.List;
                exportObject.Url = sourseURL;
                exportObject.ExcludeChildren = false;
                exportObject.IncludeDescendants = SPIncludeDescendants.All;
                SPExportSettings settings = new SPExportSettings();
                settings.SiteUrl = sourseURL;
                settings.BaseFileName = "export.cab";
                settings.FileLocation = @"C:\";
                settings.CommandLineVerbose = true;
                settings.IncludeSecurity = SPIncludeSecurity.All;
                settings.IncludeVersions = SPIncludeVersions.All;
                settings.ExcludeDependencies = false;
                settings.ExportObjects.Add(exportObject);
                settings.ExportMethod = SPExportMethodType.ExportAll;
                settings.FileCompression = true;
                settings.OverwriteExistingDataFile = true;
                settings.LogExportObjectsTable = true;
                settings.LogFilePath = @"C:\export.log";
                settings.Validate();
                SPExport export = new SPExport(settings);
                export.Run();

            public void ImportContent(string targetURL)
            {
     SPImportSettings settings = new SPImportSettings();
                settings.SiteUrl = targetURL;
                settings.BaseFileName = "export.cab";
                settings.FileLocation = @"C:\";
                settings.FileCompression = true;
                settings.IgnoreWebParts = false;
                settings.IncludeSecurity = SPIncludeSecurity.All;
                settings.RetainObjectIdentity = false;
                settings.UpdateVersions = SPUpdateVersions.Append;
                settings.UserInfoDateTime = SPImportUserInfoDateTimeOption.None;
                settings.WebUrl = targetURL;
                settings.CommandLineVerbose = true;
                settings.LogFilePath = @"C:\import.log";
                settings.Validate();
                SPImport import = new SPImport(settings);
                import.Run();

    是否还有其他办法或者是第三方工具实现呢?

    2012年9月27日 6:18

答案

  • Hi mynameislyy,

    有两种比较快速的办法。

    1.将你的SharePoint 列表导出到Excel。然后在你的子站点创建列表的时候从Excel 导入

    2.CodePlex 上有一个导出工具,你可以使用的。

    https://splistimportexport.codeplex.com/

    注意:这里提到的第三发产品是独立于微软的,我们并不知道它的可靠性和稳定性以及安全性。在做任何动作之前,请备份你的数据。

    Thanks,

    Jack

    2012年10月2日 7:29
    版主