Reputation: 6268
I need to copy multiple document libraries, with all their contents, and file's metadata from one Sharepoint server, to another one (I'm talking about totally separate Sharepoint Instances, not just different site collections on the same Sharepoint instance).
I have no idea how could I do this, and none of the existing threads on SO, or the web seem to not function in my case. Any Ideas?
Upvotes: 0
Views: 1789
Reputation: 198
Check out Exporting a site, list, or document library using Windows PowerShell : BoostSolutions.
In a nutshell, the Powershell command is:
Export-SPWeb http://yoursitename.com/site -itemurl "/DocumentLibraryName" -includeversions all -includeusersecurity -path c:\insertfolderhere\yourfile.cmp
Document libraries are generally located in the root directory of the site so you should be able to retrieve them as above. Make sure you use the -includeversions and -includeusersecurity flags; I have had issues with the Export-SPWeb function bringing everything in if I don't use them both.
That will create a bunch of .cmp files called (in this case) yourfile.cmp, yourfile1.cmp, and so on. Copy all of these over to your other farm and then run this command:
Import-SPWeb http://thenewsite.com/site -path c:\whereveryouputtheexportedfiles\yourfile.cmp -includeusersecurity
Note, once again, the includeusersecurity flag.
Upvotes: 1