Jump to content

Move FVs data-files to another drive using a symlink


Recommended Posts

If you have enough free space on your C-drive, then there is no need to read this post, as it is aimed at those who need/want -to free the space occupied by Flightplan Visualizers (FV) data-files on the C-drive. Most of these data-files does not take up that much harddisk-space, however the cached map-tiles can easily take 1-2 GB of space. This tip is not only for FV, but can be used for other programs as well. E.g. I had the same issue myself with DCS (Digital Combat Simulator), where I was able to release +200 GB on my C-Drive, simply by moving my entire DCS installation from my C-drive to another drive and executing a single/simple CMD-command (didn't have to change/update any path/settings afterwards).


Some of you might have a computer with either a small C-drive, or a C-drive that over the years have been filed to the point where you would like to free some space by moving the data-files of Flightplan Visualizer (FV) to another harddrive. While developing FV I designed it so I could at a later point quickly change the path to utilize another drive/folder, however I never implemented a way for you to change this path in the GUI. It would be easy to implement an entry field in the settings form for specifying this folder path, however doing so I would need to implement a function to move all the data (while the program was running), and also I would need to make the installation program aware of this new path, so when updating FV it would install the new/updated flight-plans into this new folder, in stead of using the the default data folder.


In stead of implementing such a feature directly in FV, we can simply use a build-in Windows feature called "Symbolic Links" (or just "symlinks"). A symlink is a link between a "virtual" folder and a "physical" folder (you can regard it as being a special kind of a "short-cut"). Once you have made this symlink, the program (in this case Flightplan Visualizer) will simply see the virtual folder as a "normal" folder that contains the same files as those contained in the physical folder. Also it does not matter if you change the files in the virutal folder, or you chance the files in the physical folder. So this allows us to put the physical folder on the another drive, and then put the virtual folder where FV expects to find its data-files. So if putting the physical files on the D-drive, these files will only take up harddisk space on the D-drive, and on the C-drive there will only be a link, hence the files don't take any space on the C-drive (saving a file to the virtual folder, it will actually be written in the physical folder). So while you can put the physical folder anywhere, the virtual folder HAVE TO be put where FV expects to find its data: "C:\Users\[UserName]\AppData\Roaming\FlightplanVisualizer", where "[UserName]" naturally have to be replaced by your own windows user-name. Here below are the steps to go through in order to setup the symlink:


Step 1: Stop FV
If FV is running it MUST be closed. This will both ensure that any un-saved data will be saved, and also you will not be able to do some of the steps if FV is currently accessing some of the data-files.


Step 2: Backup
Before proceeding setting up this symlink, I highly recommend you make a backup of your current data-folder (using the path listed above). This will ensure that you are not loosing any data if you do something wrong in the following steps.


Step 3: Move current folder
Next you have to MOVE (not copy) the current FlightplanVisualizer with all its sub-folders from the C-drive to a new drive/folder. Once moved you can rename this folder to whatever you want (e.g. "FlightplanVisualizerData" or simply "FV-Data"). However the rest of this description is written as if it still have the name ("FlightplanVisualizer"), and it is put in the root of the D-drive ("D:\FlightplanVisualizer"). Naturally you can also copy the folder, and then delete it afterwards on the C-drive, but then a move is more simple. The reason you have to move (or copy+delete) the "FlightplanVisualizer" folder from the C-drive is that we cannot make the virtual folder as long as there is a physical folder with the same name at the same location.


Step 4: Start command-prompt
Windows does not contain any GUI for setting up a symlink, so you will need to use the CMD window. To make sure you have the rights to create the symlink, you should launch the CMD with administrator rights (e.g. in windows 10 press WIN+Q, type CMD, right-click, and choose "Run as administrator").


Step 5: Setup the symlink
To setup the symlink we simply have to type in a simple command called MKLINK (short for "make link"). However do to the names of the folder in use, the command is quite lengthy. If you want to, you can simply enter MKLINK (without any parameters) and press ENTER to see a description of the various parameters this command excepts. The first parameter is the Option to specify which kind of link we want to create. Here we will use /D to create a directory symbolic link. As you can see (beside the options) the Link (virtual folder) should be entered before the Target (physical folder). If a folder-name contains a space, the folder-parameter have to be entered in double-quotes. So I suggest you do so whether or not it is necessary (just to be on the safe side). So here below is the full command to enter, be sure to replace "[UserName]" with your actual windows user-name, and use the folder name you choose to use as the last parameter, if you placed it elsewhere, or renamed it to something else than "D:\FlightplanVisualizer". Simply type the command into the CMD Prompt window, make sure the folder names are correct (first the virtual folder, then the physical folder), then press ENTER:


MKLINK /D "C:\Users\[UserName]\AppData\Roaming\FlightplanVisualizer" "D:\FlightplanVisualizer"


Once the command have been executed, you can open a windows explore window and navigate to the folder "C:\Users\[UserName]\AppData\Roaming". Here you will see that it contains a folder called "FlightplanVisualizer". However this folder is being displayed with a special icon, as it have been identified as a link (virtual folder). At this point you can start FV, and it will start as normal. If you in FV choose the menu-item called "Open UserData-folder" (found in the "File" menu), windows will open an explore window for the folder called "C:\Users\[UserName]\AppData\Roaming\FlightplanVisualizer\UserData". This folder will appear to contain all the files it used to contain, even though these files now in stead are contained in the physical folder on a different drive (remark that the virtual folder appeared with a different icon, however the file-icons inside this folder appears with the normal file-icons).


Symbolic links are cool and can be used for many things. As written in the first paragraph symlinks can be used for other programs, like I used it to move my entire DCS installation/configuration to another drive in 2 simple steps (move files/create symlink). I have also seen examples where symlinks have been used to only move a games MOD-folder to another drive, while keeping the rest of the game on the default drive (in case you have many/large mods installed). Also to make sure you have some kind of a "backup" of your data, you could locate a physical save/data-folder on DropBox, GoogleDrive or OneDrive, and then make a symlink where the folder used to be (e.g. to have a "backup" of all your FV -data, -settings and -flightplans on DropBox). Symlinks can also be used as means for qickly switching between different configurations. Once FS2020 releases I hope there will be a tool similar to Peter Dowsons MakeRunways that will be able to scan the scenery of FS2020 and extract information regarding airports (hopefully MakeRunways will be updated for FS2020). So if I will be able to import such data, FV could be used both with P3D and FS2020. In that case a symlink could be used to change a (sym)link between a virtual UserData-folder and a physical UserData-folder for each of your different simulators (e.g. for those of you who like myself uses FV to find inspiration of which flights to fly). You can then share the Data, Flightplans, Logs, MapCache, Unzip folder between P3D and FS2020, and only have a sim specific UserData-folder (and then have batch-files that delete/re-create the symlinks, allowing you to quickly switch between different user-data folders without having to move files, or change settings).


To delete a symbolic link, you simply delete the virtual folder. Deleting the virtual folder will not affect the physical folder or the files it contains. However be sure not to delete the physical folder by accident in stead, as it will then be gone. To clarify: if you have made a virtual folder, and you want to remove this virtual folder it is important that you delete the folder, and not delete the individual files within these folder. When you delete a single file in the virtual folder, that single file will also be deleted in the physical folder. However if you only delete the virtual folder, the files in the physical folder will remain ... if in doubt, make a backup of your physical folder before you delete anything 🙂 In all these examples I have described symlinks for folders, but symlinks can also be created for individual files (e.g. "MKLINK c:\temp\virtual-file.txt c:\somefolder\physical-file.txt"). This could be used to quickly switch between different/individual settings-files, in stead of switching between entire data-folders. Likewise to delete the virtual file, simply delete it (the physical file will not be affected).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...