none
ConvertTo-SPOMigrationTargetedPackage root object failure when using `SPExport`

    Question

  • I am running into this failure 

    > ConvertTo-SPOMigrationTargetedPackage : Package must have one root object

    which occurs when I use SPExport on a SharePoint 2010 site. What is causing that? It doesn't happen

    When I use the Powershell command Export-SPWeb with an an `ItemUrl` ("Specifies the URL of the Web application, GUID, or object to be exported.") the above failure does not occur!. Interestingly enough SPExport  does not appear to have that option(???). Why?

    Are these two commands comparatively the same? Or should I only be using the `Export-SpWeb` instead of the `SPExport` in conjunction with the `ConvertTo-SPOMigrationTargetedPackage` command?


    William Wegerson (www.OmegaCoder.Com)

    Monday, March 6, 2017 10:57 PM

All replies

  • Hi,

    The SPExport(Uri, String, String) initializes an instance of the SPExport class that specifies the URL of the source web, the location of the content migration package, and the base file name for the content migration package.

    Reference: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.deployment.spexport_members(v=office.14).aspx

    You can specify the URL of source web you need, then test whether your code works fine.

    Thanks,

    Dean Wang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, March 7, 2017 8:10 AM
    Moderator
  • Hi Dean,

    When I specify these options

    var export = new SPExport(new SPExportSettings()
        {
           SiteUrl                                = siteUrl,
           FileLocation                       = targetDirectory,
           ExportMethod                    = SPExportMethodType.ExportAll,
           IncludeSecurity                   = SPIncludeSecurity.All,
           OverwriteExistingDataFile  = true,
           CommandLineVerbose       = true,
           LogFilePath                        = $@"{targetDirectory}\ExportLog.txt",
           FileCompression                 = false
        });
     
       //        export.Settings.TestRun
     
               export.Run();

    Why does `ConvertTo-SPOMigrationTargetedPackage` report no root folder when I use the package created from `SPExport`?

    For the log file specified during the export above reports no errors.

    Can `SPExport` be used with `ConvertTo-SPOMigrationTargetedPackage`. If not what is the required way to extract a site from SharePoint 2010?


    William Wegerson (www.OmegaCoder.Com)




    • Edited by OmegaMan Tuesday, March 7, 2017 4:08 PM
    Tuesday, March 7, 2017 3:25 PM
  • Was this issue ever resolved? I'm trying to migrate a site collection from SharePoint 2013 to SharePoint Online, and I'm experiencing a the same issue with Export-SPWeb.
    Friday, July 7, 2017 2:39 PM
  • No never.  

    David Jenkins

    Tuesday, October 23, 2018 8:04 AM