Sharepoint automate documnet library copy

Member_2_7968778
Member_2_7968778 used Ask the Experts™
on
Hi all,

We have a document library with various folders and files on SharePoint 2010.

We would like to make an automated job that copies the data from this library at the head office and paste it in a different environment at the Backup site.

Any suggestions what we can do? Example PowerShell script, SharePoint job etc…
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Cloud Expert
Most Valuable Expert 2013
Top Expert 2014
Commented:
I often automate such processes using a stand alone server and Task Scheduler. This can run Powershell using a service account.

However pure powershell doesn't save all the metadata, i.e. the authorship and created timestamp. That can be an issue for compliance.

It's also possible to write powershell getting tools such as Sharegate and Metalogix Content Matrix to do the move, which do preserve all the metadata but licenses are not cheap.

Easiest and cheapest way is to write powershell that sees SharePoint as UNC path and do a Copy-Item for the file with caveats I mention above.

$SourceLibrary="\\myDomain\sites\mySiteCol\myBusinessSite\"

$TargetLibrary="\\myOtherDomain\sites\mySiteCol\myBusinessSite\"

$Filenames = Get-ChildItem $SourceLibrary

ForEach ($File in $Filenames) {

Copy-Item -literalpath $File.FullName -destination $TargetLibrary -force

}

Open in new window

Jamie McAllisterCloud Expert
Most Valuable Expert 2013
Top Expert 2014

Commented:
Working solution suggested

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial