How to save Apple Time Machine backups to cloud services like OneDrive

Home / How to save Apple Time Machine backups to cloud services like OneDrive

How to save Apple Time Machine backups to cloud services like OneDrive

Time Machine is an awesome feature, and in my opinion, is the best feature of macOS. Yes, Windows has File History, but even as a diehard Windows fan (its my natural computing home), it’s nowhere near as comprehensive as Time Machine. You can literally restore a Mac and pick up exactly where you left off previously, without having to re-install your applications, setting up preferences or faffing around with drivers!

However, it relies on you having an external hard disk drive plugged in in order for it to back up. Surely, in 2018, there must be a way to backup to cloud services? I have a whole 1 TB of space just sitting there with my Microsoft Office 365 subscription that could be put to better use. Whilst, I already have my Documents, Pictures, Music, Videos and even my Desktop folder, backed up to OneDrive and redirected on my Mac, what about my applications, preferences and the system in general?

Surprisingly, Apple does not offer an option to use cloud services for Time Machine. But, like most things Mac, where there’s a will, there’s a way and I was determined to find it.

Well, actually, I didn’t have to look that hard. I previously did an article on saving Time Machine backups to a network drive and with a little bit of modification, here’s how you can save your Time Machine to OneDrive, Google Drive, iCloud, or whatever your preferred cloud service might be.

How does it work?

For the purposes of this article, I’m using OneDrive but it works in the same way with other services. Presuming you already have the cloud sync service working on your Mac, following these steps is pretty straightforward and will only take a few moments.

We need to create a virtual drive, store it in the cloud service and then mount it to our Mac. With a little bit of tweaking to Time Machine settings, your Mac will then recognise the virtual drive and start saving to it automatically.

Whenever macOS saves changes to the virtual drive, the OneDrive app will sync those changes back to the cloud.

Bear in mind, however, your virtual drive will have to be stored on your MacBook as well in order to be accessible to Time Machine and stay in sync with the cloud. You will need sufficient disk space in order to do this.

Create a virtual drive

The beauty with a virtual drive is, even if you specified the full 1 TB as allocated space for the virtual drive, the actual space being taken up will only be as large as the files contained within.

You want to save the disk image within your cloud drive folder. For me, I just had to browse to the OneDrive folder on my Mac and save the disk image here.

  • Open Disk Utility. You will find this in the Applications folder, or like me, just call up Spotlight and type it in.
  • From the File menu, choose New Image > Blank Image
  • In the Save As window, browse to your Cloud drive folder and give your virtual drive a name, such as MacBookTM
  • Enter the maximum amount of size your virtual drive should be. For me, I entered 200 GB as it’s unlikely my 240 GB MacBook Pro will ever be this full.
  • Make sure Mac OS Extended (Journaled) is selected as the Format.
  • I would recommend choosing Encryption and 128-bit is fine for me. You will be prompted to enter a password so make sure it’s something you will remember – you don’t want to be teased with a backup that you can’t open in times of need!
  • Select the Single partition – Apple Partition Map as the option for Partitions.
  • Finally, choose sparse bundle disk image as the Image Format.
  • Check the size of your disk image – mine kept changing so make sure your allocated size is correct.
  • Click Save.

MacOS will set up your virtual drive. You might be prompted for your password, if you chose an encryption option.

You can then quit Disk Utility.

Mount the virtual drive

On my machine, the virtual drive mounted automatically and MacBookTM appeared on my desktop.

If yours doesn’t, open Finder and browse to the location where you saved the disk image. Double click on it to mount the image.

Configure Time Machine to recognise our virtual drive

This bit looks a little tricky but is actually really simple.

  • Open up Terminal, or again, just call up Spotlight and type it in.
  • Type in the command sudo tmutil setdestination /Volumes/{mounted-disk-image} where {mounted-disk-image} is the name of the mounted disk on your desktop, i.e., MacBookTM
  • Press Enter
  • Type in your macOS password if you prompted and press Enter.
  • Type exit and press Enter
  • Quit Terminal

Set up Time Machine

Almost done now!

Open Time Machine from System Preferences and your newly created drive should show up automatically. If it doesn’t, click on Select Disk.

Exclude your OneDrive folder from Time Machine

This isn’t necessary but I would recommend it. Otherwise, you’ll be backing up your cloud sync folder to within Time Machine as well… and then storing it on the cloud sync folder.

To exclude a folder:

  • Within the Time Machine Preferences, click on Options
  • Click on the small + icon and select your cloud folder, for instance, OneDrive
  • Click Exclude and then Save

And you’re done…

Time Machine will start backing up to your virtual drive and OneDrive will begin syncing those changes back to the cloud. No more having to search for that external hard disk, or waiting to connect to a network server.

Let’s hope you don’t need to use Time Machine’s restore facility and it might be a bit of a pain having to download your backup at the time but believe me, it’s much more painful losing your stuff!

10 thoughts on “How to save Apple Time Machine backups to cloud services like OneDrive

  1. Martyn Starkey     February 7, 2019 4:43

    Great job, thanks for this, I’ve been looking for exactly this solution for a while! One question, what happens if the backup file is larger than the space available on the mac – can the Onedrive option to “Free up space” be used or won’t that work in this scenario & you need to have the physical space available?

    • Lhyam Sumal     February 8, 2019 3:14

      Thanks Martyn. Unfortunately you need to have the physical space available for this method to work – the “Free up space” option in this scenario would prevent Time Machine from writing to the disk image.

  2. Adam     February 8, 2019 3:38

    Thanks Lhyam for your reply. That’s a helpful explanation. Since I wrote to you I’ve been looking at setting up symbolic links in the OneDrive folder using MacDropAny, which I think is the mirror image of what you’ve done. As I’m not sharing across operating systems, I think that might work as well as the approach you and How to Geek outline. And thanks for the comments about the virtual drive space. Much appreciated, Adam

  3. Adam     February 8, 2019 4:28

    Thanks Lhyam for your reply. That’s a helpful explanation. Since I wrote to you I’ve been looking at setting up symbolic links in the OneDrive folder using MacDropAny, which I think is the mirror image of what you’ve done. As I’m not sharing across operating systems, I think that might work as well as the approach you and How to Geek outline. And thanks for the comments about the virtual drive space. Much appreciated, Adam

  4. Martyn Starkey     February 8, 2019 4:28

    Great job, thanks for this, I’ve been looking for exactly this solution for a while! One question, what happens if the backup file is larger than the space available on the mac – can the Onedrive option to “Free up space” be used or won’t that work in this scenario & you need to have the physical space available?

    • Lhyam Sumal     February 8, 2019 6:38

      Thanks Martyn. Unfortunately you need to have the physical space available for this method to work – the “Free up space” option in this scenario would prevent Time Machine from writing to the disk image.

  5. Kesh     May 19, 2019 8:52

    I am stuck at terminal. once I enter the location, and add mac os password it says :jamillah is not in the sudoers file. This incident will be reported.

    what am i doing wrong?

    • Berserk Computers     May 22, 2019 5:20

      Hi, that sounds like you might not have proper admin access. Are you able to use the Terminal with the sudo command for any other task, like sudo mkdir TestFolder – does that create a TestFolder in your Home directory? You want to make sure that you are logged in as an admin rather than a limited user account.

  6. Min Soe Zan     July 10, 2019 10:38

    ok. but, how about restoring from onedrive timemachine?

  7. Anthony Junior     August 4, 2019 11:22

    I have set this up. I used CloudMounter to mount the OneDrive locally and everything appears to be working like a charm. I’ve excluded iCloud and Dropbox items as these are already in the cloud. My main focus here was to backup machine build/settings/preferences as these take a long time to get set up if you are building from scratch. Only problem is if I ever have to restore my machine, I won’t be able to mount the OneDrive at the macOS restore screen to then pick the Time Machine backup – any suggestions as this would complete this option?

Leave a Reply

Berserk Computers

Berserk Computers

Call Now
View map
%d bloggers like this: