Onedrive Personal CloudSync?

Trevor68

Contributor
Joined
Oct 15, 2021
Messages
130
yes
 

ragametal

Contributor
Joined
May 4, 2021
Messages
188
I was also using Cloud Sync to backup my files from onedrive (and I don't think I'm alone considering the Microsoft 365 subscription includes 1TB of storage and Microsoft 365 is widely used in the corporate world).

As many of you have said, after upgrading to TrueNAS-SCALE-23.10.0.1, Onedrive disapeared from the list of providers in "Cloud Credentials".
1701082634269.png


The reasons for this seems to be incompatibility with the latest Python installed in Truenas Cobia. However, if you go to the CLI of TrueNAS and invoke the config command for rclone, OneDrive IS listed as one of the options.

1701082913597.png

1701082969169.png


This tells me that the Rclone version installed in the Cobia (which TrueNAS uses for its Cloud Sync functions) is still supporting Onedrive. Am i mistaken?

Based on this, it seems that Onedrive is only missing from the TrueNAS GUI.
Is this considered a bug?
Or the bug is that Onedrive is still available on via the CLI and should have been eliminated as well?

This is important to me because if OneDrive will also be removed from the CLI in the future, then i need to find an alternative solution such as a installing rclone as a docker container and use that.

If someone from IXSystems could chime in it would be very helpful as this is affecting corporate customers as well.
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
This is important to me because if OneDrive will also be removed from the CLI in the future, then i need to find an alternative solution such as a installing rclone as a docker container and use that.

If someone from IXSystems could chime in it would be very helpful as this is affecting corporate customers as well.

Why wouldn't you install onedrive sync as a docker container instead? You load load into docker any python version you want.
 

ragametal

Contributor
Joined
May 4, 2021
Messages
188
Thanks @sfatula . There are three reasons why i haven't used the onedrive sync client:
  1. I like to use the built-in functions of TrueNAS whenever i can to keep things simple (Cloud Sync in this case).
  2. Going the Rclone route would allow me to deploy that solution into almost any other system (Useful if i ever have to migrate out of TrueNAS) and use almost any other cloud provider i want.
  3. And this is the most important one: I NEVER THOUGHT OF THAT, thank you!!!.
Based on that i think i will try the Rclone route, maybe even deploying it via a container, just so i can learn how to do it. That way if (when?) TrueNAS decides to get rid of cloud sync (like they did with openVPN) i would not loose this functionality.

I'm still curious to hear IXSystems response to my question above but, I'm not holding my breath. They lack of momentum on this thread makes me believe that this is not an important enough issue for most.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Going the Rclone route would allow me to deploy that solution into almost any other system (Useful if i ever have to migrate out of TrueNAS) and use almost any other cloud provider i want.
In exactly the same way that using a docker container (with onedrive sync as suggested) to do the job does... assuming you could install docker on whatever you migrate to if it isn't already included.
 

skadlec72

Cadet
Joined
Nov 29, 2023
Messages
2
I have been using this software. At the moment I run it on a windows VM that I have running on Truenas. He has release a version for TrueNas but I have not tried it yet.

Click the link below and check it out. It can sync to a ton of cloud services. I even use it to connect to my 3d printer and Ubiquiti/Unifi Cameras to pull video.
Syncovery
 

ragametal

Contributor
Joined
May 4, 2021
Messages
188
In exactly the same way that using a docker container (with onedrive sync as suggested) to do the job does... assuming you could install docker on whatever you migrate to if it isn't already included.
True, but the last portion of my original argument is still valid. If i can mange to deploy Rclone correctly, i will be able to sync with many other cloud providers (if i ever needed to) not just Microsoft 365.
 

Aren

Cadet
Joined
Apr 9, 2023
Messages
3
Hi all. I have successfully brought back the beloved OneDrive CloudSync integration to my machine. Here's the instruction:

USE AT YOUR OWN RISK

1. Open a shell to TrueNAS Scale 23.10, both ssh and the terminal from WebUI are ok.
2. Run the following command. Again, USE AT YOUR OWN RISK.



3. Run the following command, which basically reverts this PR: https://github.com/truenas/middleware/pull/11143
This is a lifesaver for me.
it works on TrueNAS-SCALE-23.10.0.1
I run the actions and did a "service middlewared restart"
and the syncs were working again.
 

cconrad

Cadet
Joined
Jan 14, 2024
Messages
1
It should be possible to download rclone to a dataset specifically set up for this (to preserve the whole thing during updates) and script the backup itself via a cron task.

Code:
/mnt/Tank/rclone/rclone sync /mnt/Tank/dataset_to_backup remote:/path/to/remote/folder --create-empty-src-dirs --metadata


You'd have to set up the OneDrive endpoint manually, but this is so easy that even I have managed to do it... cd to the rclone dataset, type

Code:
./rclone config


and follow the instructions; full docs here: https://rclone.org/onedrive/

P.S.: I believe rclone will save its config file to /root/.config/rclone/rclone.conf - it won't survive a reboot or update; you'd have to keep an extra copy of this file and have it copied back to the above location during boot.

P.S.2: Even better, set an environment variable:

Code:
RCLONE_CONFIG=/mnt/Tank/rclone/rclone.conf
I followed your instructions and they worked perfectly, so thanks for the inspiration!
I added a local user with an SSH key so that I don't have to run `rclone` as root, and it only has access to the files it needs to keep in sync.
The config file is stored in the user's home directory, which is on a dataset, so it can survive reboots/updates.
I still wonder why the system Python v3.11 (which I did not replace, by the way) would prevent rclone from using the OneDrive provider.
 

boggie1688

Explorer
Joined
Jul 9, 2015
Messages
58
Anyone having issues after upgrading to TrueNAS-SCALE-23.10.1.3

Seems to be broken on my end now.
 

Ascar

Cadet
Joined
Sep 13, 2023
Messages
5
Hi all. I have successfully brought back the beloved OneDrive CloudSync integration to my machine. Here's the instruction:

USE AT YOUR OWN RISK

1. Open a shell to TrueNAS Scale 23.10, both ssh and the terminal from WebUI are ok.
2. Run the following command. Again, USE AT YOUR OWN RISK.



3. Run the following command, which basically reverts this PR: https://github.com/truenas/middleware/pull/11143
Good man. Thank you very much! Works on Cobia 23.10.1.3 as of today - Feb 17, 2024. Required a reboot after system modifications.
 

Reley

Cadet
Joined
Feb 23, 2024
Messages
2
Hi all. I have successfully brought back the beloved OneDrive CloudSync integration to my machine. Here's the instruction:

USE AT YOUR OWN RISK

1. Open a shell to TrueNAS Scale 23.10, both ssh and the terminal from WebUI are ok.
2. Run the following command. Again, USE AT YOUR OWN RISK.



3. Run the following command, which basically reverts this PR: https://github.com/truenas/middleware/pull/11143
Worked perfectly on 23.10.1.
But after upgrading to 23.10.2, Onedrive was unavailable again.
After following your instructions, middlewared service does not start anymore. also after reboot.
Managed to revert back to 23.10.1...
 

Paddy0293

Dabbler
Joined
Sep 28, 2022
Messages
35
Worked perfectly on 23.10.1.
But after upgrading to 23.10.2, Onedrive was unavailable again.
After following your instructions, middlewared service does not start anymore. also after reboot.
Managed to revert back to 23.10.1...
maybe trie via rclone ?
 

andyjay777

Dabbler
Joined
Jan 31, 2022
Messages
27
I have been watching this thread hoping for a response from iXSystems...
As I suspected the fix that Kiva posted has been patched out.

And while there are number of alternatives proposed on this thread, none are as simple as using the GUI. There is a lot of talk about the importance of backups on this forum, and there is a dedicated Data Protection tab in the GUI.
- Backup files to another pool = use the GUI
- Backup files to Backblaze = use the GUI
- Backup files to OneDrive = rabbit hole of command line or running a VM or...

6TB of OneDrive storage is a cost effective offsite backup. But maybe not many TrueNas users are utilising it?

So I am now stuck on Scale 22. And can't update any Truecharts apps.
 

Aipoc76

Dabbler
Joined
May 29, 2023
Messages
43
After a update mine failed also. I then Deleted
Code:
/usr/lib/python3/dist-packages/onedrivesdk
and re-ran the following steps provided by Kiva.. Although my browser or this forum did truncate his link. Hopefully this stay fully normal.

Code:
git clone https://github.com/imkiva/onedrive-sdk-python
cd onedrive-sdk-python/
cp -ar src/onedrivesdk /usr/lib/python3/dist-packages
cp -ar src/python3/request /usr/lib/python3/dist-packages/onedrivesdk

cd /usr/lib/python3/dist-packages/middlewared/rclone/remote/
wget https://raw.githubusercontent.com/truenas/middleware/cd9acacac17f9a4e98883c7d8baefacd2085eea7/src/middlewared/middlewared/rclone/remote/onedrive.py
sed -i '1d;$d' onedrive.py


Rebooted and all is back to normal.

EDIT: I did have to recreate my tasks..

1708874938841.png


1708874920375.png


I think its crap that iXsystems wont just fix this for the community. Its not like Microsoft is some sort of small potato's...
 
Last edited:

Reley

Cadet
Joined
Feb 23, 2024
Messages
2
After a update mine failed also. I then Deleted
Code:
/usr/lib/python3/dist-packages/onedrivesdk
and re-ran the following steps provided by Kiva.. Although my browser or this forum did truncate his link. Hopefully this stay fully normal.

Code:
git clone https://github.com/imkiva/onedrive-sdk-python
cd onedrive-sdk-python/
cp -ar src/onedrivesdk /usr/lib/python3/dist-packages
cp -ar src/python3/request /usr/lib/python3/dist-packages/onedrivesdk

cd /usr/lib/python3/dist-packages/middlewared/rclone/remote/
wget https://raw.githubusercontent.com/truenas/middleware/cd9acacac17f9a4e98883c7d8baefacd2085eea7/src/middlewared/middlewared/rclone/remote/onedrive.py
sed -i '1d;$d' onedrive.py


Rebooted and all is back to normal.

EDIT: I did have to recreate my tasks..

View attachment 76036

View attachment 76035

I think its crap that iXsystems wont just fix this for the community. Its not like Microsoft is some sort of small potato's...
This fixed it for me as well. Thanks!
 

xkpx

Cadet
Joined
Feb 28, 2024
Messages
2
How you bypass
Code:
admin@Aurora2-truenas[~/onedrive-sdk-python]$ sudo cp -ar src/onedrivesdk /usr/lib/python3/dist-packages
cp: cannot create directory '/usr/lib/python3/dist-packages/onedrivesdk': Read-only file system
 
Top