1. Intro
Hello! It’s time to learn about Symbolic Links. But first, I’ll tell you about some practical use cases and how I use them to solve many problems. I am using Dropbox as an example, but this works for any other syncing tool you may be using.
Usecase A
I have two PC’s, with a lot of the same programs and applications installed in both. However, it’s always a bit tedious to keep them synced with each other. It’s fine for all the stuff I can put into dropbox, but some programs have Preferences and Assets that I would like to have synced, but they’re not installed in my Dropbox drive.
Before, I would probably manually copy or install preferences from one PC to the other, back and forth. It’s very time consuming and really takes away all the efficiency of having two PC’s.
Now, move the program (or the preferences folder) to my Dropbox drive, and then create Symbolic Links to where the program was in each PC. This way, whenever I want to access the program, my PC will think it’s opening it from “C:/Program Files” but instead it is being pointed to “A:/Dropbox” without it knowing. This doesn’t work with regular folder shortcuts, and is why Symbolic Links are so cool and useful.
I use this, for example, to syncronize my “Desktop” folder between my 2 PC’s and my Macbook. Works flawlessly, and whenever I want to grab some files I just drag them to my desktop and dropbox will take care of the syncing. The trick is that I have a symbolic link tricking my macbook into thinking the Desktop folder is where MacOs wants it to be, when instead it’s inside my Dropbox 😝
Usecase B
This is somewhat specific, but I’ve had cases where a path to some files is either too long, contains a special character that is giving my programs a hard time, or simply it isn’t on the same Drive Letter as everyone else on my project, and so my programs can’t find the files automatically.
In this case, I will use a Symbolic Link or a Junction to trick my PC into thinking that the path to “folder_6” isn’t “C:/folder_1/folder_2/folder_3/folder_4/folder_5/folder6”, but instead I can create a junction at the path “C:/folder_6” (without moving or copying any files), and let my computer access the files inside folder6 directly, avoiding the long path. Or, create a symbolic link at “A:/folder6” that points to the folder6 in C: drive, without moving files around.
Personally, I keep using this with Program folders and preference folders to keep them synced. However, keep in mind that many programs are not mean to be open and reading and writing to the same file at the same time, so I like to sync the files on command instead of having my Dropbox do it automatically. More on that later, if you’re interested. If you don’t intend to use the same apps in both PC’s at the same time, and you just want to have them synced for when you use either, you don’t have to worry about that.
2. Using Symlinks
Okay, so how do we create a symbolic link or a junction? You can use the Console or Command Prompt if you are feeling pro, but personally I like to use a small utility that lets you just right click in the folder or file you want, pick an option, and then right click again in your destination folder to drop a Symbolic Link or a Junction. You can download it here:
If you’re interested in the technicalities behind it, or you want to hear it form someone who knows what they’re talking about, this page has all the information you need in not just Symbolic Links and Junctions, but also an array of other options this tool offers and that can really save you some headaches and precious time. It also explains how to create the links in a well illustrated manner:
It’s as easy as that.
I encourage you to play around a bit and figure out how these work. However, keep in mind you’re working with files and folders that aren’t strictly copies, so deleting the files inside a Junction deletes the files in the original path (duh!), just be careful.
3. Caveat
Okay, so… This all sounds very cool, but what happens when you want to work with two PC’s at the same time, but also have the ability to sync them? There are a couple of options out there. I’ll explain my methodology – this is what works for me and allows me to quickly, with a few clicks, sync my latest preferences and apps with my 2nd PC, (or 3rd and 4th!):
If you have a “Main” PC that you work on, and you like to periodically send the latest preferences/files/programs to the other PC’s, you can use Symbolic Links in addition to any File Syncing app. I use Bvckup2, but there are free alternatives like FreeFileSync that work incredibly well and I use them for not just this, but a lot of other purposes.
The idea is to create a “DB Sync” folder in your Dropbox. Using FreeFileSync, you can copy and sync any files/folders and preferences to this Sync folder. On your Secondary PC’s, you can use a Symbolic Link to point to these folders and files inside the “DB Sync” folder. This way, every time you want to update the preferences to all your seconday PC’s, you can use FreeFileSync on your “Main” one and update everything inside “DB Sync”. Dropbox will auto-sync it with the other computes, that will be accessing it. That’s it!
If you have several computers, but none of them are the “Main” one, and you see yourself having to choose which PC’s settings you want to sync now…… well the good news is you don’t really need Symbolic Links for this, like at all… In fact I don’t even know why I would be talking about it in this post, since I’m sure there are big scale solutions specifically designed to distribute updates to multiple computrer in a network, but I figured I would give a rudimentary solution anyways:
Essentially, like before, you can use FreeFileSync to a “DB Sync” folder on your dropbox. The difference is, you aren’t using Symbolic Links and can just use something like FreeFileSync to choose which computer’s preferences and files get synced with the rest. Imagine computer A, B and C. Each of them has been set up with FreeFileSync to sync their original preferences folders with a copy of the preferences folder that is inside “DB Sync”. When I want B’s preferences, I got to PC B, open FreeFileSync, and sync it “Update” mode to overwrite what is inside the “DB Sync” folder. After my Dropbox has synced, I go to PC’s A and C, I open FreeFileSync and sync the original preferences folder with the ones in “DB Sync”, but this time I overwrite the original location with the files from “DB Sync”.
It’s not as crazy and convoluted as it sounds on writing, but I do feel like a lunatic when I write stuff like this.
Anyways, thank you for reading and hope you find some use to this! Like always, feel free to reach out for any questions, ideas, clarifications, or suggestions.