Setting up OneDrive (personal)

hosting-services

#1

Duplicati can back up your data to Microsoft OneDrive. Note that this guide only works for personal OneDrive accounts, not for OneDrive for Business.

To set it up, follow these steps:

  1. Configure a new backup
  2. One the connection options page choose “OneDrive”
  3. Enter the name of a folder where you want to store the backup. If the folder does not exist it will be created for you.
  4. Click the AuthID button to start the OneDrive authentication process. After clicking the link, you will be forwarded to the Duplicati OAuth handler:
    06
  5. Click the blue button, and you will be prompted to login to OneDrive
  6. After you are logged in, the window will close. If it does not, copy the AuthID value manually, and paste it into the AuthID field in Duplicati:
    21

Thats it, you are now set to backup to OneDrive. The final page should look like this:
55


Invalid AuthID for onedrive
Uploading to OneDrive always breaks after ~20min
#2

This post mentions being suspended due to “suspicious activity” when doing an initial backup to a brand new trial OneDrive account. Has anybody else seen this happening?


#3

My quota is 50gb and I filled it up overnight without issues (was on a gigabit pipe but the effective rate to MS servers probably much less…)


#4

This post mentions being suspended due to “suspicious activity” when doing an initial backup to a brand new trial OneDrive account. Has anybody else seen this happening?

I believe I now understand why this happened to me.

I had recently purchased the 1TB storage plan but onedrive.live.com was still showing me as limited to the 5GB free plan. It appears to take 10s of minutes until your purchased storage shows up. I confirmed this with a Microsoft chat agent.

I started my upload before the 1TB of storage was shown as available.

Even though it took almost 2-hours to upload the first 5GB, by which time onedrive was showing my 1TB plan, I was still cut off by the system at 5GB.

I went through the dance to unlock my account and I have not had problems since.

Marc


#5

Nice detective work! I wouldn’t be surprised to find out that what plan you’re on is requested during authentication / login and not again until you re-authenticate / login. Since you had almost continuous uploads going that whole time it probably never re-auth’ed so didn’t realize your plan level had changed.


#6

A couple of little “gotchas” for anyone reading this who has problems. These are two things I tripped over.

Unix style Directory slashes
When typing the “Path on server” the subfolders have non-windows slashes. So you must do MyBackup/folder/folder as using “normal for Microsoft” back slashes will fail to write.

Using alternate Microsoft Accounts
If you are on Charlie’s PC and setting up a back-up to Fred’s OneDrive then you may get some trouble at the get AuthID stage if Charlie has left himself logged into his Microsoft Account in the webbrowser.

This caught me out when setting up a backup on Charlie’s I was not being asked to log into Fred’s account, but was just being handed an (unusable) AuthID.

I had to open Charlie’s web browser and then LOG OUT from his Microsoft Account. Once I had done that Duplicati then asked me to login to Fred before issuing the correct AuthID.


#7

Thanks for the tips!

When you lifeguar logged out of Charlie’s account on the computer and into Fred’s account in Duplicati, did you have any difficulties with either account after getting the computer back into Charlie’s account?

I thought forward slashes were normal for Linux, not Windows

Also, I believe the original post is a Wiki, so feel free to use the Edit icon beneath the post to update it with your, um… updates, inline. :slight_smile:


#8

Whoops - firstly, typo. I meant to type that the other way around. My meaning was right, but words were wrong. So I have corrected my post above. Folder/Folder/Folder

I would repeat my previous requests of having the GUI clean up the slashes to ones that work automagically. It would make things more ID-10T proof.

As to “What happened on Charlie’s computer?” - I’ll tell you tonight when I login to check for problems. At least when I did a quick check it seemed to work. This guy stays “always logged in” on the web browser so he can edit a spreadsheet in his own OneDrive. And after my fiddling - the spreadsheet loaded as Charlie again, and the backup let me “Test Connection” with Fred’s AuthID in place. I will know for sure when I check those logs tonight.

I’ll also find out Tonight if a Win10 PC that is logged into Dave’s Microsoft Account will let me get an AuthID to Fred’s account for backup on there too.

Updated: yep - all is well. Charlie’s backup ran fine and sent data to Fred’s OneDrive. I am connected now and using Firefox to look at the backup I hit Run Now. Backup runs fine. Meanwhile Edge is open logged into OneDrive and editing a document as Charlie.

Double evil test now. Using Edge which is currently open in Charlie’s OneDrive folder editing a document. I now open a new tab for Duplicati’s Control panel to Edit the job. I test the connection to Fred’s OneDrive - still valid. So I press RUN NOW. The backup seems happy to go to Fred’s OneDrive without troubles. Even though I have a different page open in Charlie’s OneDrive. And the OS has OneDrive logged in as Charlie all at the same time. The AuthID clearly punches through that without problem.


#9

It should work that way, because Duplicati runs in an non-browser process, meaning that it does not have access to any of the browser tokens. If they would end up crossing, it would be a problem with Microsoft.

Unfortunately (for Windows users), URL’s use the Unix style slashes, so you also need to use forward slashes for paths that are really URLs.


#10

I have a foot in all OS camps. So don’t confuse me for a Windows Whiner :wink:

I assume you process the text from these edit boxes to drop other illegal characters. Is there any way you can you look for these “wrong” slashes and just flip them to the correct direction? This would make this much friendlier and less confusing.

Or put an example path into the text on the dialog? With such an empty box it is not even clear if there should be slashes at the start \ end.

It can be slightly comical when putting in the wrong slashes as the error is misleading.


#12

I whine over Windows regularly :smile:

Are you sure it does not auto correct automatically? There is code here that fixes it:

(Note this is for the OneDrivev2 backend, the OneDrive backend using passwords is being shut down by microsoft in 5 days).

Sure, that is just a matter of editing the “placeholder” tag here:


#13

Yeah, I am sure it doesn’t auto-correct. Put in slashes in a Windows native manner and I get a “Can’t write” error when pressing the test button. Swap slashes to the correct way and the test then works.

Is that code running when pressing the test button?


#14

I will refine my reply here. When the “wrong” slashes are used I don’t get an error to say no access. I get an error that tells me the folder does not exist and asks me if it should be created.

If I see that error I know to cancel and swap the slashes the opposite way and all will be well.

So I am guessing the error message you are getting when it can’t write is a little confused.

It is especially confusing because if I answer “yes” to creating the folder it creates something somewhere and then merrily carries on as it nothing is wrong… but then fails to backup.


#15

It should, but if it does not work for you, then I guess it does not run.


#16

So what can I do to assist the debugging here? Next time I do this can I turn on more debugging info for you?

Or would it be enough for me to do an exact description of what happens?

To my initial guess it looks like the error coming back is incorrectly being interpreted as “connection fine, folder missing” as I am asked if I want to create a folder. This is my signal to hit cancel and flip the slashes.

(Sorry - can’t remember exactly what happens if I let Duplicati attempt to create the folder. I think it proceeds to tell me it created the folder and stumbles forward… but nothing was created and no access to OneDrive. This bit in brackets I’d need to check)


#17

@BatterPudding, what version are you running? There was a bug in 2.0.3.12 where the NormalizeSlashes method that @kenkendk linked to was not run. This was fixed in 2.0.3.13.


#18

This was with the beta version last week.


#19

Just to clarify, were you using the OneDrive or OneDrive v2 backend? As @kenkendk mentioned, the NormalizeSlashes method is not called in the non-v2 version.


#20

I have no idea. Whatever was last week’s beta is the one I was using.

Sorry, but I don’t follow all the development conversations on here so I have no idea who’s backend was in use.


#21

An experimental (precursor to a beta) release just came out - hopefully a beta won’t be far behind. :slight_smile: