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…
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jamie McAllister MVPCloud ExpertCommented:
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.



$Filenames = Get-ChildItem $SourceLibrary

ForEach ($File in $Filenames) {

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


Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jamie McAllister MVPCloud ExpertCommented:
Working solution suggested
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.