Multiple OneDrive Personal Storages

This could be a total newbie issue here!

I’m running Duplicacy v2.7.2 (Web GUI) on an unRAID server in a docker. I’ve setup the folders I want to backup on the unRAID server, so they are available to the Duplicacy docker container.

I had setup 1 x OneDrive Storage and several Backups and several schedules. Duplicacy was working as expected until my OneDrive storage started to fill up. I hadn’t created any prune jobs! Not knowing how long that was going to take me to figure out, I created a 2nd OneDrive Personal account and setup one backup and one schedule and that worked BUT all of my other jobs started to fail at this point.
Storage One = one://Duplicacy
Storage Two = one://Backups

My questions is, can I have 2 x OneDrive Personal storage locations and have some jobs setup to backup to the 1st Storage and other jobs setup to backup to the 2nd storage?

The check job that still works shows this:

Running check command from /cache/localhost/all
Options: [-log check -storage Duplicacy2 -a -tabular]
2022-03-31 14:45:02.253 INFO STORAGE_SET Storage set to one://Backups
2022-03-31 14:45:13.337 INFO SNAPSHOT_CHECK Listing all chunks
2022-03-31 14:49:31.629 INFO SNAPSHOT_CHECK 1 snapshots and 1 revisions
2022-03-31 14:49:31.629 INFO SNAPSHOT_CHECK Total chunk size is 222,185M in 44857 chunks
2022-03-31 14:49:31.828 INFO SNAPSHOT_CHECK All chunks referenced by snapshot PL002 at revision 1 exist
2022-03-31 14:49:32.198 INFO SNAPSHOT_CHECK 
  snap | rev |                          |  files |    bytes | chunks |    bytes |  uniq |    bytes |   new |    bytes |
 PL002 |   1 | @ 2022-03-27 20:30 -hash | 179032 | 285,127M |  44857 | 222,185M | 44857 | 222,185M | 44857 | 222,185M |
 PL002 | all |                          |        |          |  44857 | 222,185M | 44857 | 222,185M |       |          |

And the check job that fails shows this:

Running check command from /cache/localhost/all
Options: [-log check -storage Duplicacy -a -tabular]
2022-03-31 14:45:02.005 INFO STORAGE_SET Storage set to one://Duplicacy
2022-03-31 14:45:02.228 ERROR STORAGE_CREATE Failed to load the OneDrive storage at one://Duplicacy: invalid character '}' after top-level value
Failed to load the OneDrive storage at one://Duplicacy: invalid character '}' after top-level value

This is the log from a failed Backup (the ones that fail show the same error):

Running backup command from /cache/localhost/4 to back up /unRAIDShares/appdata
Options: [-log backup -storage Duplicacy -threads 4 -stats]
2022-03-31 03:00:01.256 INFO REPOSITORY_SET Repository set to /unRAIDShares/appdata
2022-03-31 03:00:01.256 INFO STORAGE_SET Storage set to one://Duplicacy
2022-03-31 03:00:01.256 ERROR STORAGE_CREATE Failed to load the OneDrive storage at one://Duplicacy: invalid character '}' after top-level value
Failed to load the OneDrive storage at one://Duplicacy: invalid character '}' after top-level value

Any constructive advice would be greatly appreciated.

You can. The key is to keep separate credential files.

Note, Duplicacy saves the path to the json file with access credentials. To use different onedrive accounts each should naturally refer to a separate json file.

There is a long time ask to fix this by saving credentials themselves as opposed to a reference to a file that most likely is in users downloads folder and would not persist.

@saspus - I’m a little confused with your response, but thank you, it made me go back and look a lot closer at where things are within the docker container on unRAID. I also poked around in each of the JSON files to see what I could see.

I found the one-token.json file in /config. I think when you add a new storage location, it takes the one-token.json file created for the OneDrive access and writes over whatever is already in /config/one-token.json file???

I also found /config/duplicacy.json which has a “storages” section and it looks to have several lines (one_token and password) for the Credentials for each of the storage locations. I’m guessing this was created when the storage gets added to Duplicacy in the first place and looks like it shouldn’t be edited directly.

I have the two JSON credential files for the two different storage locations. I copied the first storage locations credentials file over the one-token.json file and I now have access to the 1st storage location again. That it a good thing! Thanks again for your help.

It could be obvious, but I cannot see it. Do you know what I need to do to get Duplicacy to access both storage locations without having to overwrite the /config/one-token.json file with the appropriate one for the storage location I need to use each time?

To connect to OneDrive you need to go to OneDrive for Duplicacy, authenticate, and then file with credentials will be downloaded. Put it anywhere you want (e.g. in /config/ folder) and name it something like /config/one-drive-account_uno.json. In the WebUI you then provide path to this file when adding first OneDrive storage and duplicacy will use information in this file to make calls to OneDrive for that storage.

To Add another storage representing another OneDrive account you need to repeat the steps to generate credentials from that other OneDrive account, and save the downloaded file with different name, e.g. /config/one-drive-account_dos.json.

No need to do anything in duplicacy config files or overwrite token files: the key is to have different token files associated with different storages representing different accounts.

I see said the blind man! So it is done at the initial setup stage of the storage. Awesome. Thank you very much for your advice and sharing your knowledge @saspus. I wonder how we can get this detailed added into the documentation? It would have been great for this detail to be available there. Thanks again.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.