Avoid losing precious data by practicing some Zen calm

Image by wirestock on Freepik

Here are GIS Central we’ve been fielding a lot of calls from frustrated users, along the lines of:

“I finished my project last night but when I opened it up this morning, everything was gone!”

-Frustrated in Whangarei

“That layer I spent hours on doesn’t work any more – when I open up the table I get an error”

Losing it in Lyttelton

“I HATE GIS!!!!!”

Most everyone from Manganui

Sadly, we’ve been getting a lot of that this year – and I feel your pain, believe me. Hopefully this post will prevent any future issues while also encouraging a bit of Zen calm in us all (and heaven knows I need all of that I can get at the moment).

The issue here is with OneDrive. ArcGIS and OneDrive have never played nicely together, but these issues can be mainly be avoided by doing the following when you’re ready to log off:

  • Save your project
  • Close Pro
  • Wait at least 20 seconds – take five deep breaths, mediate on a supreme being of your choice, take a nap, listen to this, or even this, whatever it takes
  • Then log off the computer

That’s all you need to do.

Now for the gory bits – here’s what’s happening behind the scenes. Before I open up Pro and do anything fun, note the status icons on the right side of your taskbar:

The OneDrive icon looks nice and calm and seems to be sitting by idly:

Whenever you add a layer to a map, some temporary files get created. These are called lock files and you can see them if you know where to look. They’re called lock files because they prevent anyone else from editing the layer you’ve got on your map. In the image below, I’ve added the gpspts shapefile to my map:

If I take a peak in the folder where this layer lives using File Explorer, I’ll see the lock file:

Here there are actually two, the ones ending in “sr.lock”. And notice too that the OneDrive icon is now busy trying to syncing:

Time passes, tools get run, maps get made and it’s time for you to log off and get to your next assignation. Here’s where the trouble arises. These lock files don’t go away until several seconds after Pro closes. After a wee bit, the lock files go away:

If you don’t leave enough time for the files to self-destruct and for OneDrive to sync things up, data get corrupted (they often end up drinking beer and smoking cigarettes in dark alleyways, making rude comments to innocent passersby) and, worst case, disappear. All that hard work, just gone.

It’s not safe to log off your computer until the OneDrive icon returns to idle:

By waiting a few seconds for OneDrive to catch up, you could save yourself hours of repeat work, heartache and a general loss of faith in GIS (which we all encounter from time to time).

I can’t guarantee that this will solve all your problems but it may go a long way towards reducing one of the more frustrating ones.