Relocated Files, What's Up Catalina?

Relocated Files, What's Up Catalina?

by Jason Lewis on Nov 8, 2019

SITE NAME CHANGE: Hi there, this is just a quick note to explain why the site name seems to have changed. I've decided that my personal domain of Gecko8 wasn't nearly descriptive enough. I want to cover not just code, but how to make our lives better as developers. With that goal in mind, I feel Life And Code is a better choice. I hope you agree!

Apple recently released MacOS Catalina, it's latest iteration of the well known operating system. The other night I had the thought "Hmm, I don't have a lot on the go at the moment, I may as well upgrade. How bad can it be?" Well, everything went pretty smooth until I started opening up my various client projects and discovered a couple things. One, my databases no longer connect and all my code and database files are in a mysterious "Relocated Files" folder. And two, the default shell has been switched from Bash to zsh. I'll talk about the zsh issue in a future post but let's talk about the Relocated Files folder.

Relocated Files Path In Visual Studio Code

Changes to The File System

You probably noticed when MacOS Mojave came out that there was a lot of talk about the new file system APFS. In Catalina this change went a big step further. One of the features of APFS is the ability to compartmentalize the storage in to volumes. You can think of the drive as a locker room and volumes are the individual lockers. In Catalina, Apple split the drive into two volumes, one for all the projected system files and one for user data. The upgrade analyzes your drive and moves the files accordingly. You probably won't notice much change as the OS blends the two together in the Finder.

So What's the Catch

This should be smooth sailing and for most users it is. In my case, at some point I ran into permission issues with storing my code, etc. in the Users folder. So I had the great idea of creating a Data folder at the root of the drive where I store all my code, database files, etc. No more permission problem! But then along comes Catalina and the installer tries to split the drive files into volumes. It comes to my Data folder and goes "Huh? What's this doing here? That's not the Apple way!" and helpfully moves it to a /Users/jason/Relocated Items/Data folder. And all my database server links, Docker volumes, and GIT references break.

Fixing Things

Man Fixing Things

Photo by Clem Onojeghuo on Unsplash

Fortunately, the fixes were pretty straightforward, if time consuming. Everyone's situation will be different but for me I had to do the following.

Fix Databases

I use Docker to run all my database servers and store all the data in Docker volumes so the fix was pretty easy. Just stop and remove the containers, then recreate them using the existing volumes. And the new local volume paths!

GIT Repositories

I use SourceTree for doing things like merges, etc. with my GIT repositories so I just had to delete and re-add the bookmarks by adding the local repositories.

Cloud Storage

For me I only had OneDrive syncing to that folder so I needed to change where OneDrive was syncing. That was a bit of a fiasco in itself but I won't go into details here.

Naturally, you'll have to reload projects in VS Code or your editor of choice but that's not a huge deal.

The Conclusion

Caution Sign

Before updating to Catalina, do a review of your drive and make sure you're doing everything the Apple way. In other words, put all your project files, etc. in the Users folder and just deal with the permission issues. If you don't, Apple will do it for you, and you're much more qualified!

If you'd like to know more detailed steps for any of these, let me know in the comments!