So the word came out that the office is migrating to Windows 7 at some yet-to-be-determined time, but soon. It’s in testing now. (Too bad they didn’t recruit me as part of the testing team, because breaking Windows 7 is one of my superpowers.)

We’ve been told to back up our data. Lots of people are paranoid that they’ll lose their Outlook PST files, and with it, their ability to do top-drawer work. Frequently we have to search our archives to find forgotten details about old projects. It helps to make the new projects go more smoothly.

I came up with a surprisingly easy solution. It doesn’t even require admin rights–which is good. I won’t elaborate.
It involves some command-line hocus-pocus. Fortunately our machines have Robocopy on them. I believe Windows Vista and 7 come with Robocopy; it’s part of the resource kit for earlier versions.

To do this right, you’ll need Robocopy. So if you don’t have it, get a copy of the Resource Kit. You can run Robocopy.exe without installing the Resource Kit, if need be.

First, I strongly suggest closing Outlook. If you’re really paranoid, it’s even better to reboot. Closing Outlook should be sufficient, but I’ve seen files get stuck open and in use before. A reboot is the easiest way to keep it from happening to you. The odds may really be one in a million, but if it’s my data, I’m not taking that chance. It’s a lottery you don’t want to win.

Next, create a directory on your desktop. Since I have to be at a command prompt anyway to run Robocopy, I’ll do it from a command line.

md %userprofile%\desktop\backup

Now here’s the command to have Robocopy scour your entire drive for PSTs and copy them into your new directory/folder.

robocopy c:\ %userprofile%\desktop *.pst *.ost /z /s /r:2 /w:2 /xd %userprofile%\desktop

This command will scour the drive, retry twice if it can’t copy a file for some reason, and, most likely, generate a ton of error messages along the way, especially if you don’t have admin rights. Unlike Windows Explorer or the traditional DOS xcopy, Robocopy will automatically retry the specified number of times, then ignore the error if it persists and keep chugging away.

If it gets interrupted really badly (like a power outage, or a consultant named Bruce walking by and turning off your system), just power the system back on, log in, and run the command again. It will pick up where it left off. Robocopy is really cool like that.

Once it finishes, archive that backup folder off onto DVD, an external drive, or some other media. You can zip the file if you want.

Once the migration happens, root out the PSTs (and possibly the OSTs) from the backup, copy them somewhere that makes sense, and open them inside Outlook.

Easy? Relatively. Obvious? Nope. Knowing about things like Robocopy helps keep me employed.

If you’re not familiar with Robocopy, I strongly suggest you become familiar with it. I’ve used it to copy tens of gigabytes of data across unreliable WAN connections that drop intermittently and without notice. Sometimes I started it on the Friday before a 3-day weekend and it finished around mid-day the following Tuesday, but it got it done. Like a Joshua Tree, it can thrive in the harshest of environments.