Remove previously copied files with robocopy

DollaBillz 121 Reputation points
2020-09-26T17:00:51.567+00:00

I'm getting ready to migrate my users over to a new file server. For the last month I've been using robocopy to copy files from the existing file server to the new one. The issue is any files users have moved, deleted, etc, remain on the new server since they were already copied over during a previous robocopy. Is there a way for robocopy to remove files on the destination server that don't match the source? It's only 80GB of data so if I have to just delete all the files and re-copy them I can

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
11,702 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Falcon IT Services 226 Reputation points
    2020-09-26T19:09:07.32+00:00

    Hello Bill,

    There are several switches that may apply but I can't say for sure because I don't have the exact details of your requirements. For example:

    /purge deletes files that are no longer in the source

    /mir mirrors a directory tree

    /mon monitors the source and runs again when changes are detected

    If only 80GB then the likely best option is to delete or rename the old destination folder, then copy source to destination again. This will ensure a fresh copy and you can run one of the options above like /mon or /mir to keep the files fresh in both locations.

    https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy

    Cheers

    Miguel Fra
    www.falconitservices.com


  2. Falcon IT Services 226 Reputation points
    2020-09-26T19:26:39.02+00:00

    Hello,

    Those are temporary files that applications create when the file is open. Check the view setting set the same for source and destination. You may have hidden files set to view in the target folder.

    0 comments No comments

  3. 2020-09-27T02:19:32.077+00:00

    Hi,

    I agree with MiguelFra, If only 80GB then the likely best option is to delete or rename the old destination folder, then copy the source to the destination again.

    Or you can see:

    https://superuser.com/questions/121693/delete-dupe-files-from-source-move-only-missing-across-to-target-in-robocopy

    Best Regards,
    Daniel

    0 comments No comments