Windows 10: Dealing with Symbolic Links & Backing Up User Folder

Discus and support Dealing with Symbolic Links & Backing Up User Folder in Windows 10 Network and Sharing to solve the problem; Reference posts:... Discussion in 'Windows 10 Network and Sharing' started by Cormy1, Aug 10, 2020.

  1. Cormy1 Win User

    Dealing with Symbolic Links & Backing Up User Folder


    Reference posts:
    https://answers.microsoft.com/en-us/windows/forum/all/how-does-windows-7-backup-treat-symbolic-links/dce802f0-e043-445f-8462-70fc15c0872e

    https://answers.microsoft.com/en-us/windows/forum/windows_10-files-winpc/how-to-move-user-folders-to-2nd-drive-in-windows/5c851aca-c2ec-4386-a0e4-f56688bc8e75

    This seems to be a truly neglected topic across the net.

    How does one properly replicate a directory that contains a symbolic link?
    For example, within C:\Users\User\ there should be an Application Data symbolic link pointing towards the AppData folder for backwards compatibility.
    Similarly, in the AppData\Local directory there is an Application Data symbolic link which points back to AppData\Local
    I believe these to actually be junctions rather than symbolic links. In any case, the result is that one can continuously and transparently enter the Application Data junction until you reach the URL character limit, as it is always treated as though you are navigating to a new directory, whose contents are the same as the original directory.

    For the purpose of backing up a user on a Windows system, it's necessary that these symbolic links, junctions and likely hardlinks get copied and remain functional, without your program following the links themselves.
    I believe /SL is SUPPOSED to do this with ROBOCOPY from an administrative cmd because elevated permissions are required to make junctions/symlinks
    Unfortunately the generated links don't seem to properly work

    Why do I want to do this? Context:


    I have a very filthy Windows installation. On the same partition is all of my user data.
    I want to offload my data so that I can partition the drive and keep my system/program files separate from my user data.
    How can I go about doing this? 99% of the backup solutions I come across involve backing up the entire drive/creating images, or they only backup standard media/files but don't really cover the job of correctly rebuilding all the directories, including symbolic links and things like librairies.
    My assumption is that a lot of that stuff is managed at the level of the registry, or perhaps even the file table of the filesystem...? In any case, it's a huge hassle and I'm trying to figure out how to go about doing this properly.

    I DON'T want to include my user directory in the system image backup, as it includes AppData, one of the largest directories on my computer. I want to be able to backup my operating system alone, without the user folder.


    I'm getting the impression that I'll only be able to backup my files though, and that I should simply create new user profiles, and then migrate my data to them. Unfortunately I can't figure out how to make new user profiles on another partition than the one Windows is installed on. You can do it with libraries, but the most important thing to me is to isolate the AppData folder, containing all my program customizations and program data browser/gamefile saves
    I imagine I can use a symbolic link to point to a User folder in another location, but first I need to ensure that user folder is "legit" by being able to properly back it up/move it including these symbolic links!

    So again, I have a single partition, on which ALL of my data exists. I want to separate my base system files so that I could also create an image of them for backup and more easily modify them without dealing with fragmentation and program files from my user files for the sake of accessibility and fragment management/ability to image/back THOSE up aswell
    And in the very end, I'd likely restore the system image onto an SSD as I have currently always worked with an HDD.

    Why go through all this trouble? The point is transparent migration, proper compartmentalization and partition/image/backup size management.

    :)
     
    Cormy1, Aug 10, 2020
    #1
  2. Bree Win User

    Exclude folder form Symbolic link ?

    Xcopy and Robocopy are not third party apps - they are Windows 10 command line utilities, presumably being used here to make backup copies of user files. I wrote my own .bat file using Robocopy that does full or incremental backups of my user folder to an external or network drive of my choice. I very soon learned the perils of Robocopy and symbolic links...
    The dangers of robocopy and symbolic links

    The switch I had to use for Robocopy is:
    /XJD :: eXclude Junction points for Directories.

    This one may be of use to @JerometheGiraff:
    /SL :: copy symbolic links versus the target.

    You could try combining that with...
    /XD dirs [dirs]... :: eXclude Directories matching given names/paths.
    ...but I'm not sure if that applies to symbolic links.

    Get to Know Robocopy for More Powerful File Management
    Robocopy and a Few Examples
    Type Robocopy /? in a command prompt for the full list of options or see:
    https://technet.microsoft.com/en-gb/...mands/robocopy

    Xcopy is far older than Robocopy and dates back to DOS 3.2. It supports the options:

    /EXCLUDE:file1[+file2][+file3]...
    Specifies a list of files containing strings. Each string should be in a separate line in the files. When any of the
    strings match any part of the absolute path of the file to be copied, that file will be excluded from being copied. For example, specifying a string like \obj\ or .obj will exclude all files underneath the directory obj or all files with the .obj extension respectively.
    ....
    /B Copies the Symbolic Link itself versus the target of the link.

    Type Xcopy /? for the full list.
     
  3. Windows Reset - Symbolically Linked User Folder

    I plan on running a reset of Windows soon. I will choose the option to keep personal files. My system's Users folder is stored on a separate hard drive than the system itself. I used a symbolic link on C to direct programs to the Users folder on E. If
    I reset, choosing to keep personal files, will this link be broken? If so, will I be able to login, recreate the link, and keep my existing accounts? Or will I have to create new accounts entirely?
     
    NWalker1208, Aug 10, 2020
    #3
  4. coder789 Win User

    Dealing with Symbolic Links & Backing Up User Folder

    Symbolic links inside linked folder

    Hi

    I'm creating symbolic links of one folder (Missions folder) to server so that the server can load the missions from the linked folder and this works. But the problem is that when I create symbolic links inside the sub folders (of Missions folder) then the
    server fails to load those sub folders folders.

    I made pic to demonstrate this problem, the
    link's here
    . The red is the Missions folder link to server folder and the Mis A sub folder contents are symbolic linked to Mis B & Mis C folders (blue line) . But server fails to load the B & C subfolders, only the sub folder Mis A can be loaded by the
    server.

    Does anyone know why it doesn't work?

    thanks!
     
    coder789, Aug 10, 2020
    #4
Thema:

Dealing with Symbolic Links & Backing Up User Folder

Loading...
  1. Dealing with Symbolic Links & Backing Up User Folder - Similar Threads - Dealing Symbolic Links

  2. Symbolic links/Folder links

    in Windows 10 Network and Sharing
    Symbolic links/Folder links: Apologies for the long introcution first; I have read a number of questions and answers relating to symbolic links with interest, and have noted that del, rmdir mklink, file explorer are all dangerous tools to use in order to remove a symbolic link. I had a PC with several...
  3. Symbolic links/Folder links

    in Windows 10 Gaming
    Symbolic links/Folder links: Apologies for the long introcution first; I have read a number of questions and answers relating to symbolic links with interest, and have noted that del, rmdir mklink, file explorer are all dangerous tools to use in order to remove a symbolic link. I had a PC with several...
  4. Symbolic links/Folder links

    in Windows 10 Software and Apps
    Symbolic links/Folder links: Apologies for the long introcution first; I have read a number of questions and answers relating to symbolic links with interest, and have noted that del, rmdir mklink, file explorer are all dangerous tools to use in order to remove a symbolic link. I had a PC with several...
  5. Symbolic Link on C:\Users\xxx

    in Windows 10 Network and Sharing
    Symbolic Link on C:\Users\xxx: Hello, Why is it forbidden to use a symbolic link on the" C:\users\me" folder to move all the files of the "me" user to another disk? I've done this before on Windows 10 with no troubles, but maybe I got lucky!...
  6. Symbolic Link on C:\Users\xxx

    in Windows 10 Gaming
    Symbolic Link on C:\Users\xxx: Hello, Why is it forbidden to use a symbolic link on the" C:\users\me" folder to move all the files of the "me" user to another disk? I've done this before on Windows 10 with no troubles, but maybe I got lucky!...
  7. Symbolic Link on C:\Users\xxx

    in Windows 10 Software and Apps
    Symbolic Link on C:\Users\xxx: Hello, Why is it forbidden to use a symbolic link on the" C:\users\me" folder to move all the files of the "me" user to another disk? I've done this before on Windows 10 with no troubles, but maybe I got lucky!...
  8. Syncing folders using symbolic links

    in Windows 10 Network and Sharing
    Syncing folders using symbolic links: Hi everyone! I have a question about symbolic links on Windows 10. How can I sync folders using the function "mklink" CMD, and point to a folder which already exists, without creating a new folder? is it even possible? Because when I create a symbolic link in that way, it...
  9. Symbolic links inside linked folder

    in Windows 10 Network and Sharing
    Symbolic links inside linked folder: Hi I'm creating symbolic links of one folder (Missions folder) to server so that the server can load the missions from the linked folder and this works. But the problem is that when I create symbolic links inside the sub folders (of Missions folder) then the server fails to...
  10. Exclude folder form Symbolic link ?

    in Windows 10 Support
    Exclude folder form Symbolic link ?: Can I use Xcopy / Robocopy to create not only a symbolic link but exclude a folder from the symbolic link creation ? 80242