1

I need to migrate a document library includings all its documents and all meta data to another site collection. I did some research and quickly found a script that would seem to do the job, see source below.

Using Windows PowerShell ISE, I ran the script on a test libary in our test environment, only filling out those four initial parameters (site url etc). For the test, I have a site column with some simple text and a normal column (so local on the library itself) that's a lookup to values in another list on that site. When I ran the script it successfully copied over all the documents to the target location, but not the meta data.

What am I doing wrong or missing here? Does the meta data have to be of a certain type (columns or site columns). Can it migrate look-up columns? Would be great to hear some feedback as migrating it manually is really not do-able.

Source: https://gallery.technet.microsoft.com/office/Copy-all-SharePoint-Files-0999c53f

1

2 Answers 2

4

Indeed, as Sergey B. Hizof pointed out in the comment above, the Export-SPWeb and Import-SPWeb PowerShell commands work great to copy sites or lists/libraries to another location. Here's a good explanation (https://technet.microsoft.com/en-us/library/ee428301.aspx ) and here's a good video about it: https://www.youtube.com/watch?v=8WgPeYMd4Ss.

There are a couple of things to keep in mind though:

-when your meta data contains look-ups or term sets, you have to make sure to copy/create those at the target location first, before migrating the actual list or library itself (at least, that worked for me). Otherwise, that meta data will be missing at the target location (because it can't do the lookup or does not have the term set available).

-this approach works great within a 2013 environment, but not when migrating content from older versions to 2013; you might run into version issues. Another discussion on this site offers some solutions to that problem: How to export a list in SharePoint 2010 and import it into 2013

1

Have you checked the script in the link below? It can be a starting point on what you want to achieve.

Here's the link: http://splibrarycontentmigration.codeplex.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.