locked
Using Powershell or Other Script to copy document library from one domain to another domain RRS feed

  • Question

  • All,

    I have a SharePoint 2010 farm located in one domain (we will call it domain a) and am looking to copy from domain a, a certain document library into a site collection on a SharePoint 2013 farm located in the second domain (we will call it domain b) document library. Therefore, I don't seem to see a Powershell way to do this but was wondering if it can be done in Powershell? Otherwise, I assume that somehow I can use a Client side script to get the SharePoint 2010 content I need then use server side to copy the content into the SharePoint 2013 environment.

    I should note that the SharePoint 2010 document library has folders with attachments as well as custom fields I am looking to copy into my SharePoint 2013 environment.

    The structure in both locations is the same so for example - in SharePoint 2010 I have a site collection called:

    http://myspsite.mydomain.com/sites/doc1/docs and am looking to copy the doc library docs to a SharePoint 2013 location as such:

    http://myspsite2.mydomain2.com/sites/doc1/docs the only difference is the domain.

     

    Monday, May 20, 2019 5:07 PM

Answers

  • Hi kmoneill,

    There are three methods for your reference:

    1. You can use Export-SPWeb command in SharePoint 2010, change the exported list .cmp file, then use Import-SPWeb command in SharePoint 2013.

    2. Migrate Content Database of the Site Collection in which the library is, mount database to a new SharePoint 2013 web application, export the library, then import to relevant site collection.

    You can check the post below to get more detailed step:

    migrating a document library from sharepoint 2010 to sharepoint 2013 without using 3rd party tools

    3. third-party tools

    Best regards,

    Grace Wang


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

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Marked as answer by kmoneill Thursday, May 23, 2019 9:28 PM
    Tuesday, May 21, 2019 6:49 AM

All replies


  • One option is to save the library as a template (include content) and then download the .stp list template file, then copy the template file to another farm, create a new library based on the template, then all the metadata and file will remain in the newly created library.

    select "Include Content" to make data in library remain when generating list template.


    Please remember to click Mark as Answer on the answer if it helps you

    Monday, May 20, 2019 6:19 PM
  • This would be great but because I'm crossing domains - it doesn't work the error is as such - which is why I believe I need to have client side for the source and server side for the destination:

    Get-SPWeb : Cannot find an SPSite object that contains the following Id or Url:
    https://myspsite.mydomain.com/sites/doc1/.
    At D:\Powershell\SP_Copying_Test.ps1:21 char:9
    + $sWeb = Get-SPWeb $SourceWebURL
    +         ~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (Microsoft.Share....SPCmdletGetWeb:SPCmdletGetWeb) [G
       et-SPWeb], SPCmdletPipeBindException
        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetWeb

     

    Monday, May 20, 2019 7:12 PM
  • This would be great but the document libraries are too big - I tried a smaller one and it errors:

    The list is too large to save as a template. The size of a template cannot exceed 52428800 bytes.

    Monday, May 20, 2019 7:14 PM
  • It wouldn't be supported to save as template anyways and transfer between versions. You need to get a migration tool, e.g. Sharegate.

    Trevor Seward

    Office Servers and Services MVP



    Author, Deploying SharePoint 2016

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Monday, May 20, 2019 7:36 PM
  • Hi kmoneill,

    There are three methods for your reference:

    1. You can use Export-SPWeb command in SharePoint 2010, change the exported list .cmp file, then use Import-SPWeb command in SharePoint 2013.

    2. Migrate Content Database of the Site Collection in which the library is, mount database to a new SharePoint 2013 web application, export the library, then import to relevant site collection.

    You can check the post below to get more detailed step:

    migrating a document library from sharepoint 2010 to sharepoint 2013 without using 3rd party tools

    3. third-party tools

    Best regards,

    Grace Wang


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

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Marked as answer by kmoneill Thursday, May 23, 2019 9:28 PM
    Tuesday, May 21, 2019 6:49 AM
  • No, you cannot use Export-SPWeb to import from 2010 to 2013. This is *not* supported.

    Trevor Seward

    Office Servers and Services MVP



    Author, Deploying SharePoint 2016

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Tuesday, May 21, 2019 2:01 PM