{"id":11854,"date":"2021-01-20T11:43:59","date_gmt":"2021-01-20T11:43:59","guid":{"rendered":"https:\/\/fhug.org.uk\/kb\/?post_type=kb_article&#038;p=11854"},"modified":"2023-09-08T09:12:46","modified_gmt":"2023-09-08T09:12:46","slug":"synchronizing-family-historian-settings-using-directory-junctions","status":"publish","type":"kb_article","link":"https:\/\/www.fhug.org.uk\/kb\/kb-article\/synchronizing-family-historian-settings-using-directory-junctions\/","title":{"rendered":"Synchronizing Family Historian Settings Using Directory Junctions"},"content":{"rendered":"<p>Creating directory junctions within Windows provides a mechanism whereby selected features, including plugins, queries, and fact sets, can be synchronized automatically between multiple PCs.\u00a0 Users should have a good understanding of basic Windows file structures, using cloud storage, and working at the command line to set these up successfully .<\/p>\n<p>Important note: Directory Junctions have been known to cause problems when installing <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> updates, so it is more reliable if you use Directory Junctions as described to download the exe and install from that, rather than use the in-application upgrade procedure.<\/p>\n<h2>Why Are Directory Junctions Needed?<\/h2>\n<span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> treats the storage of configuration data and files differently to the way it treats user projects. While the default location for user projects is the &#8220;Family Historian Projects&#8221; folder, within your Documents folder, this can be changed to any location that you wish to use, either locally on your PC, or even directly to network storage.<\/p>\n<p>Other files that you may create while using <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> do not have this flexibility.\u00a0 For example, it expects to find plugins in a specific location in your ProgramData folder, and will not accept any other location.\u00a0 For use on a single PC, this is not normally a problem.\u00a0 However, if you are using <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> on two separate PCs, as permitted by the standard licence, each copy of <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> will only look in its own ProgramData folder, and not accept a common shared location.<\/p>\n<p>As a result, additional features such as plugins, custom queries, and custom fact sets have to be copied manually between PCs whenever they change.\u00a0 It would be very frustrating to be using <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> away from home on a laptop, only to realise that the key plugin or query that you need has not been copied across.<\/p>\n<h2>What Are Directory Junctions?<\/h2>\n<p><em>Directory junctions<\/em> are a facility available within current versions of Windows that effectively makes files or folders appear to be in two <glwrap>places<\/glwrap> at the same time. A full discussion of the various types of link that are available is beyond the scope of this introductory article, but more details are available in the links given at the end of the page. Directory junctions do not create a second copy of linked folders. There is only ever one physical copy of the file, but it effectively has two different <glwrap>addresses<\/glwrap> in the internal Windows file management system.\u00a0 The linked folder is normally referred to as the <em>Link<\/em>, and the folder that actually contains the files as the <em>Target<\/em>.<\/p>\n<p>Junctions can be created to link directories located on different partitions or volume, but only locally on the same computer, not to a network location. Both the source and target partitions must be formatted with the NTFS file system, but as this is the only file system now supported by Windows for its own partition, virtually all internal drives are formatted with NTFS on Windows PCs.<\/p>\n<p>Junctions become even more powerful if used in conjunction with cloud storage. In the diagram below, folders in the user\u2019s cloud storage synchronise automatically with the local OneDrive or Dropbox folder. If a directory junction is created on each PC linking a location within the OneDrive or Dropbox folder with a <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> configuration folder, this means that any change in that folder on one PC are automatically mirrored on the other.<\/p>\n<h3><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/fhug.org.uk\/kb\/wp-content\/uploads\/2021\/01\/Directory-Junctions.png\" alt=\"Cloud synchronisation\" width=\"443\" height=\"203\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 443px; --smush-placeholder-aspect-ratio: 443\/203;\" \/><\/h3>\n<h3>Which Way Round?<\/h3>\n<p>The easiest way to set up the links described above is to keep all the relevant <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> folders in their original locations on each PC, and create a link folder within OneDrive or Dropbox. Cloud storage then keeps these two link folders synchronised. Unfortunately, neither OneDrive nor Dropbox fully support immediate two way synchronisation of link folders, and are only updated when full scans of changes are made, for example when first logging on, or forced manually. This is undesirable for our purposes, as key updates may not be replicated immediately.<\/p>\n<p>The recommended solution for <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> synchronisation is to move the original configuration folders to OneDrive or Dropbox as appropriate, and create the link folders where <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> expects to find them. <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> (and most other local apps) neither knows nor cares whether it is dealing with the link or the target, but with the target folders in cloud storage, synchronisation is automatic and immediate in both directions.<\/p>\n<h2>Which Folders to Synchronise?<\/h2>\n<p>As tempting as it might be to synchronise the entire ProgramData\\Calico Pie\\<glwrap>Family<\/glwrap> <glwrap>Historian<\/glwrap> folder between PCs to ensure that as much as possible is kept updated automatically, this is not in general a good idea, as some settings may be specific to an individual PC (and should definitely not be done if the two PCs are running different versions of <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>).\u00a0 While in principle it would be possible to synchronise any folder that can be exported or imported using the standard <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> menus, it is best limited to folders that contain customised material that you use regularly.\u00a0 The most common ones are:<\/p>\n<ol>\n<li>Plugins (C:\\ProgramData\\Calico Pie\\<glwrap>Family<\/glwrap> <glwrap>Historian<\/glwrap>\\Plugins)<\/li>\n<li>Custom Queries (C:\\ProgramData\\Calico Pie\\<glwrap>Family<\/glwrap> Historian\\Queries\\Custom)<\/li>\n<li>Fact Types (C:\\ProgramData\\Calico Pie\\<glwrap>Family<\/glwrap> Historian\\Fact Types)<\/li>\n<li>Autotext (<span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7 only) (C:\\ProgramData\\Calico Pie\\<glwrap>Family<\/glwrap> Historian\\Autotext)<\/li>\n<\/ol>\n<p>Other candidates for syncing include Diagrams, Reports, Text Schemes, Flags, Icons, and Property Box tabs.<\/p>\n<h2>Setting Up a Junction<\/h2>\n<p>This work through is for creating a junction to synchronise the Plugins folder via OneDrive.\u00a0 For other folders, change the folder name as appropriate, and in all cases substitute the path to the OneDrive or Dropbox folder on your PC.\u00a0 Individual steps are described in sufficient detail for the advanced PC user to follow what is required.\u00a0 You should ensure that you understand what each step below is doing prior to starting.<\/p>\n<ol>\n<li>The ProgramData folder is hidden by default, so ensure that File Explorer is set to display hidden files.<\/li>\n<li>It is best to pause OneDrive synchronisation while setting up this link, so right click on the OneDrive icon in the Notification area and select &#8220;Pause syncing&#8221;.<\/li>\n<li>Create a new folder in OneDrive to store <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> settings.\u00a0 This example uses FH\u00a0as the folder name.\u00a0 If you use the &#8220;Files On-Demand&#8221; facility in recent versions of OneDrive, it is best to ensure that this folder is always available locally, as per the screenshot below, to avoid any problems accessing it when off-line.<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/fhug.org.uk\/kb\/wp-content\/uploads\/2021\/01\/Keep.png\" alt=\"OneDrive settings\" width=\"354\" height=\"311\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 354px; --smush-placeholder-aspect-ratio: 354\/311;\" \/><\/li>\n<li>Move the C:\\ProgramData\\Calico Pie\\<glwrap>Family<\/glwrap> Historian\\Plugins folder to sit underneath the new folder created in OneDrive, in this case OneDrive\\FH\\Plugins.<\/li>\n<li>Creating a junction requires elevated privileges, so we need to open the Command Prompt as an administrator.\u00a0 Enter &#8220;cmd&#8221; (without the quotes) into the Task Bar search box.\u00a0 This displays a shortcut to the Command Prompt app.\u00a0 Either right click on the shortcut and select &#8220;Run as administrator&#8221;, or click on the &#8220;Run as administrator&#8221; option if this is shown directly (different versions of Windows may display shortcuts slightly differently).\u00a0 Windows User Account Control will prompt you for the administrator password for your PC. If you do not get a password prompt, it means that you are using an administrator account already. \u00a0<a href=\"https:\/\/www.windowscentral.com\/how-use-windows-10-non-admin-and-why\" target=\"_blank\" rel=\"noopener\">This is not recommended for normal PC use<\/a>.<\/li>\n<li>Directory junctions are created with the &#8220;mklink&#8221; command, with the following syntax:\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-linenumbers=\"false\">mklink \/J Link Target<\/pre>\n<p>where \/J creates a directory junction, Link is the folder that is to be the new junction, and Target is the folder that serves as the target for the link, where the files are actually stored.\u00a0 In this case<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-linenumbers=\"false\">mklink \/J \"c:\\ProgramData\\Calico Pie\\Family Historian\\Plugins\" c:\\Users\\MyUserName\\OneDrive\\FH\\Plugins<\/pre>\n<p>Quotes are only required where the path includes spaces.\u00a0 Do not use the %ONEDRIVE% shortcut to refer to your OneDrive folder, as this will create the junction in the Administrator&#8217;s OneDrive, not yours!\u00a0 Spell out the path in full.<\/li>\n<li>\u00a0Repeat steps 2-6 on each PC that is to share the folder.<\/li>\n<\/ol>\n<p>Junctions are displayed in File Explorer with a small link icon, as shown below for a PC with synchronised Plugins and Custom Queries folders.<\/p>\n<p><img decoding=\"async\" class=\"alignnone lazyload\" data-src=\"https:\/\/fhug.org.uk\/kb\/wp-content\/uploads\/2021\/01\/File-Explorer-Links.png\" alt=\"Directory Junctions in File Explorer\" width=\"127\" height=\"147\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 127px; --smush-placeholder-aspect-ratio: 127\/147;\" \/><\/p>\n<p>To delete a directory junction, simply delete the Link folder (the one with the link icon).\u00a0 Do not accidentally delete the Target folder, as this also deletes its contents.<\/p>\n<p>Re-enable OneDrive (or Dropbox) synchronisation on each PC, and the folders will be kept synchronised automatically.\u00a0 If the folder contents were different on each PC prior to setting up the junctions, they will be amalgamated, so it is recommended to review the contents of each folder first to ensure that any obsolete files are removed and the latest version of any common files is the one you want to make available on synchronised PCs.<\/p>\n<p>If you are operating different versions of <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> on each computer, this process works exactly the same, but it would be good practice to ensure that any plugins or queries that only run in one version are suitably renamed to make this clear in the <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> menus.<\/p>\n<p>If you need to reinstall <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> for any reason, you will need to re-establish these links. Delete the default copies of the relevant folders within ProgramData, and rebuild the links as in steps 5-6 above.<\/p>\n<h2>Further Reading (Optional)<\/h2>\n<div class=\"lightweight-accordion\"><details><summary class=\"lightweight-accordion-title\"><h3>Graphical Method (Link Shell Extension)<\/h3><\/summary><div class=\"lightweight-accordion-body\"><p>The recommended method for setting up directory junctions for use in <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> is to use the command line as described here, as it is easy to do and requires no additional software.\u00a0 For those with a strong preference for working with graphical tools rather than the command line, there is an optional tool available as a free download, <a href=\"https:\/\/schinagl.priv.at\/nt\/hardlinkshellext\/linkshellextension.html\" target=\"_blank\" rel=\"noopener\">Link Shell Extension<\/a>.<\/p>\n<\/div><\/details><\/div>\n<div class=\"lightweight-accordion\"><details><summary class=\"lightweight-accordion-title\"><h3>Other Uses For Directory Junctions<\/h3><\/summary><div class=\"lightweight-accordion-body\"><p>Even if you are working with a single PC, directory junctions may be useful for other purposes:<\/p>\n<ul>\n<li>Continuous and automatic backup &#8211; creating junctions with a folder in your cloud storage will give you copies of the <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> ProgramData and AppData folders that are always up to <glwrap>date<\/glwrap>, with the ability to roll back any unwanted changes.\u00a0 This complements the <a href=\"https:\/\/pluginstore.family-historian.co.uk\/page\/plugin\/backup-and-restore-family-historian-settings\">Backup and Restore <glwrap>Family<\/glwrap> <glwrap>Historian<\/glwrap> Settings<\/a> plugin rather than replacing it, as it does not backup configuration data stored in the Windows Registry.<\/li>\n<li>Relocation of program folders &#8211; if you wanted to relocate the <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> ProgramData folder to a high capacity second internal hard disk, creating a directory junction would allow you to do that.<\/li>\n<\/ul>\n<\/div><\/details><\/div>\n<div class=\"lightweight-accordion\"><details><summary class=\"lightweight-accordion-title\"><h3>Symlinks and File Systems<\/h3><\/summary><div class=\"lightweight-accordion-body\"><ul>\n<li><a href=\"https:\/\/www.howtogeek.com\/16226\/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux\/\" target=\"_blank\" rel=\"noopener\">Links and Junctions<\/a><\/li>\n<li><a href=\"https:\/\/www.howtogeek.com\/196051\/htg-explains-what-is-a-file-system-and-why-are-there-so-many-of-them\/\" target=\"_blank\" rel=\"noopener\">File Systems<\/a><\/li>\n<\/ul>\n<\/div><\/details><\/div>\n<p>&nbsp;<\/p>\n<div id=\"highlighter--hover-tools\" style=\"display: none;\">\n<div id=\"highlighter--hover-tools--container\">\n<div class=\"highlighter--icon highlighter--icon-copy\" title=\"Copy\"><\/div>\n<div class=\"highlighter--icon highlighter--icon-change-color\" title=\"Change Color\"><\/div>\n<div class=\"highlighter--icon highlighter--icon-delete\" title=\"Delete\"><\/div>\n<\/div>\n<\/div>\n","protected":false},"template":"","fh_version":[13,14,15,739],"skill_level":[18],"topic":[96,79,95],"class_list":["post-11854","kb_article","type-kb_article","status-publish","hentry","fh_version-v4","fh_version-v5","fh_version-v6","fh_version-v7","skill_level-advanced","topic-backup-and-restore","topic-synchronising-data-with-the-internet","topic-using-cloud-storage"],"_links":{"self":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article\/11854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article"}],"about":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/types\/kb_article"}],"wp:attachment":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/media?parent=11854"}],"wp:term":[{"taxonomy":"fh_version","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/fh_version?post=11854"},{"taxonomy":"skill_level","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/skill_level?post=11854"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/topic?post=11854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}