Sharepoint automate documnet library copy

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…
Member_2_7968778Asked:
Who is Participating?
 
Jamie McAllister MVPConnect With a Mentor SharePoint ConsultantCommented:
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

0
 
Jamie McAllister MVPSharePoint ConsultantCommented:
Working solution suggested
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.