Hi to all shocked users of the recent Mac OneDrive update.
I was horrified also to see all of my OneDrive files and folders removed after a recent update installation which turned on the "Files-on-Demand" and disallows it from being disabled. This was done without my permission and without the impending change being made clear to me. The installation merely asked for my permission to access the local OneDrive folder! Luckily, I never used this folder as my primary work space but had always used the very fine FreeFileSync app (https://freefilesync.org/) to copy files and folders over to my local OneDrive folder.
Now, I have a work-around that leaves files and folders physically in the same place in your Mac's OneDrive folder but can still synchronise with your OneDrive in the cloud.
First of all, I deleted the OneDrive app and any hidden related files.
Then I deleted the entire contents of the OneDrive folder with it's links to
Library > CloudStorage > OneDrive-Personal
.ODContainer-OneDrive
UBF8T346G9.OneDriveStandaloneSuite directory
Next and to be absolutely sure my primary work space didn't get messed up, I used FreeFileSync to copy all files and folders over to my empty OneDrive folder. You can configure files to be excluded such as .DS_Store and .sync.ffs_db
Now, you have two choices where the first one would take longer, requires more work for the cloud OneDrive and, if you forget or didn't note what you'd updated, is prone to error:
1. Using a web browser and your Microsoft login details,
log into your cloud-based OneDrive,
delete any folders or files you think you've changed and then drag replacement
files and folders from your local drive to OneDrive in your web browser;
2. Use Terminal to enter rclone commands (https://rclone.org/docs/ and https://rclone.org/onedrive/)
to copy or synchronise files and folders from your local OneDrive folder to your cloud-based OneDrive.
You can instal rclone directly or by using Homebrew.
I found the following two sources to be very helpful:
https://roadtopetabyte.medium.com/tutorial-how-to-install-rclone-and-configure-rclone-browser-on-your-mac-rclone-gui-for-macos-a97e13925ab0 and
https://research.reading.ac.uk/act/knowledgebase/rclone-sync/
For configuring rclone, note two things:
1. As of February 22 2022, Microsoft OneDrive is no longer 23 in the list of
available cloud storage devices but 27;
2. On my first attempt, I saw that rclone defaulted to OneDrive Business and
didn't give the option of choosing OneDrive Personal. So, I keyed ^C to quit the
configuation, deleted the remote I'd created and then created a new one.
For this second attempt, under Edit advanced config, I chose yes.
Then, just keyed Enter for all defaults except under Option drive_type, where I entered Personal.
Once you've successfully obtained a token for your cloud storage device, you'll be able to use the commands,
rclone copy or rclone sync. You'll need to obtain another token, if you don't use rclone for three months.
Be careful with rclone sync as this will delete files on the destination if they don't exist on the souce.
A simple example rclone command would be:
rclone sync <source files or folders> <your destination OneDrive name>:/<destination files or folders>
eg. rclone sync /Users/<User name>/OneDrive/Desktop <your OneDrive name>:/Desktop
However, for completeness, it's probably better to refer to a text file you'll make, listing all file types you don't want to copy or sync.
Then, your command would look something like:
rclone sync /Users/<User name>/OneDrive/Desktop <your OneDrive name>:/Desktop --exclude-from ~/.config/rclone/exclude.conf
where exclude.conf is the name of your exclusion text file, with the following example contents:
.DS_Store/**
.sync.ffs_db/**
.thumbnails/**
.vagrant/**
.gitignore
.git/**
.Trash/**
.Trashes/**
.apdisk
.com.apple.timemachine.*
.fseventsd/**
.DocumentRevisions-V100/**
.TemporaryItems/**
.Spotlight-V100/**
.localization/**
TheVolumeSettingsFolder/**
$RECYCLE.BIN/**
System Volume Information/**
Wishing you success and more satisfaction with your Mac and OneDrive syncronization...