In an age where everything has gone digital, we tend to store document after document as if our capacity were infinite. If things can get out of hand at home, imagine a company with hundreds of users saving files to the network every day. Nobody ever wants to delete anything, and the general trend is to duplicate, triplicate or quadruplicate the same file in different folders.
To deal with duplicates, modern storage arrays already include deduplication: they remove repeated data and, using pointers, keep a single copy while still showing it in every location, which saves disk space. But in the end that may not be enough, and over time the volumes fill up anyway.
Going back to the habit of keeping everything, we end up with documents dating from 1990 to today, of which only about 40% are actually used (being optimistic). The rest can’t simply be deleted: they have to be kept, but perhaps not in their original location, where besides taking up valuable space they make the daily backup longer. It’s better to make a couple of copies and archive them somewhere with quick access, in case any of them has to be consulted or restored in the future.
Archiving old documents isn’t that simple. Many people’s first instinct is to search the internet for some magic program that does it by ticking a couple of options and clicking “OK”. I don’t know whether anything that nice exists; if it does, I haven’t found it. What does exist is a very complete console tool that lets us do it safely and efficiently: robocopy. It’s a Microsoft command that started life in the Resource Kit, and it copies files with lots of extra options and actions that the plain copy command lacks.
How I archived mine
First, I made a full copy of the volume to magnetic media (backup tape) to keep that insurance in the safe. Then I created a smaller volume than the original to move the old files to; I’ll keep them hidden there for a month or two so I can restore data in seconds if needed. I also prepared a USB hard drive with another copy of the moved files, which I plan to keep indefinitely for quick recovery or reference. These days a 250 or 500 GB drive costs next to nothing and, with a USB 3.0 enclosure, I can make sure I’ll be able to restore data easily for very little money.
Robocopy has a huge number of switches and options. These are the ones I used:
/s: copies subdirectories./e: copies subdirectories, including empty ones./minage:N: minimum file age in days; excludes files newer than N days./copyall: copies all file properties, such as creation and modification dates and NTFS permissions./mov: moves files, deleting them from the source and leaving only the copy at the destination./log:xxxx.txt: writes a log of every action to a plain text file./xd Directory: source directories to skip during the process.
Very important: before running the final command, add the /l switch. It performs a full dry run so you can see what will happen when you run it for real.
In the end, the command looked like this:
robocopy s: y: /s /e /minage:1699 /copyall /mov /log:log_robocopy.txt /xd "S:\Folder 1" "S:\Folder 2" "S:\Folder I don't touch 3" "S:\Folder I don't touch 4"
Translated with the help of AI from the original article.
