0

I want to migrate files from local drives to SharePoint Online. Copying files with the Windows Explorer changes the file dates, which I want to keep. My goal is to create a Batch file which helps the user to migrate the files to the cloud. The process needs to be as simple as possible for the enduser.

Robocopy does a good job by mirroring a complete folder BUT I can't connect it to SharePoint.

First I stumbled upon this thread here. When trying to map or access the SharePoint directory the CMD prompt wants me to add the SharePoint to the trusted sites.

Then I found this script here BUT when I run it none of the commands is recognized nor do they work.

My current code is this:

ROBOCOPY "C:\Users\XYZ1234\OneDrive\DEMO_SharePoint" "C:\Users\XYZ1234\Company\TestSharePoint - Dokumente\Robocopy Test" /COPY:DATO /MIR

This copies the files to the synced SharePoint folder on my computer (and keeps the created date) but when they are uploaded the created date/time is equal to the copy date/time.

Now I'm stuck. Any ideas from the community?

0

Unfortunately, this is undoable, as Sharepoint's files metadata is populated when it is uploaded such as the (Creator, File Created Date, and Last Modified Date).

2
  • When I use robocopy the Last modified date is carried over to SharePoint. :-| – Der_Fab May 26 at 10:17
  • Yes, that is because "Last Modified Date" is referring to the "Last Modified Date" in Sharepoint, not on the local computer, I suggest not wasting anymore time pondering on this small issue as it will not affect anything else, if I helped, do mark my answer as the acceptable answer, thanks! – NoPurposeInLife May 26 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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