Moving Documents folder to other path

I have setup OneDrive sync with my Mac and mount the path to /Users/faizal/OneDrive, inside I have Documents folder. I would like to create symlink for this /Users/faizal/OneDrive/Documents to default Documents folder. But I cannot move or delete original Documents folder, it will keep appear everytime I delete it. I use terminal and Finder, both also does not work.


Can anyone help? Thank you

MacBook Pro 13″, macOS 11.5

Posted on Sep 7, 2021 12:10 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 7, 2021 9:24 PM

The script does work but need to immediate issue ln command after moving or deleting Documents. I guess there is some background script running to create the Documents upon deletion. This is what I did:


sudo mv -f ~/Documents ~/Documents.backup && ln -s ~/OneDrive/Documents ~/Documents


Weird though this does not happen to Desktop folder, only happens on Documents. I haven't try yet with Photos and Music but that is not a priority right now.


Yes understood the fallback of cloud storage, I was thinking of using NAS or Time Machine but having to take care another appliance is a headache. Plus cloud storage is cheap and I have fast+cheap internet. Just need to make sure to turn off sync if I'm using mobile internet.


Thank you

Similar questions

5 replies
Question marked as Top-ranking reply

Sep 7, 2021 9:24 PM in response to James Brickley

The script does work but need to immediate issue ln command after moving or deleting Documents. I guess there is some background script running to create the Documents upon deletion. This is what I did:


sudo mv -f ~/Documents ~/Documents.backup && ln -s ~/OneDrive/Documents ~/Documents


Weird though this does not happen to Desktop folder, only happens on Documents. I haven't try yet with Photos and Music but that is not a priority right now.


Yes understood the fallback of cloud storage, I was thinking of using NAS or Time Machine but having to take care another appliance is a headache. Plus cloud storage is cheap and I have fast+cheap internet. Just need to make sure to turn off sync if I'm using mobile internet.


Thank you

Sep 7, 2021 12:58 PM in response to fzal

Here is an article designed for macOS IT SysAdmins to move Desktop, Documents, etc. to a cloud drive and symbolically link back to the home folder normal paths. Then also recreating the Finder left-sidebar Favorites.


I do not recommend running the script but read through it to understand it.

The script is meant to be customized to your particular situation.

The first few lines at the top are variables you need to define, etc.


https://www.c-amie.co.uk/technical/redirecting-home-folders-to-onedrive-dropbox-or-google-drive-on-macos/


Summary:


  1. Move the original Documents (and optionally other folders) to the OneDrive folder
  2. Create a symbolic link in /Users/faizal/Documents pointing to /Users/faizal/OneDrive/Documents
  3. Recreate the Favorite item in Finder sidebar so it still works.


Rinse and repeat for each other folder such as Desktop, Pictures, etc.


OneDrive keeps a local copy of the file and uploads the file to the cloud. Moving them on disk will be quick but it may take time for the cloud copy to be sync'd. It should not hurt performance locally. However, depending on how you pay for your Internet bandwidth, in some parts of the world this would increase your network costs. I would recommend a fairly fast broadband connection for OneDrive usage. OneDrive works remarkably well. I use it at work between multiple Macs and PC's.


OneDrive is not exactly a backup solution. If you delete something in OneDrive it's placed in the cloud RecycleBin where it will be erased after 30 days. If you use Free Space instead of Delete then the local copy is removed with a pointer to the cloud copy left in place. If you have more than one computer accessing this OneDrive you can also force a local copy to always be kept on one device.


You should establish a backup process as a precaution, just because files are in the cloud as a sync'd copy you need to ensure you have a backup such as Time Machine to provide historical backup over time.

Sep 7, 2021 12:13 PM in response to fzal

Generally not a good idea to do this. OneDrive like everything else on the internet is asynchronous in communication. Every file you put up there takes as much as 10-20 times as long as bringing it back down. This will slow your Mac down significantly for any significant size file repository. You are better making a symbolic link to an external hard drive than to the OneDrive, and using your OneDrive just as a cloud backup.

Sep 7, 2021 12:47 PM in response to a brody

Reason being I want to sync files across multiple devices, I have few Windows machine for development. Furthermore OneDrive is cheaper than iCloud in term of storage price. Sync latency is ok for me but issue I'm having right now is I cannot even create the symbolic link even on the same hard drive. It kept on appearing no matter how many times I delete it.


Is there ACL or SIP involve here? I already stopped iCloud drive for Desktop and Documents.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Moving Documents folder to other path

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.