Database Backup

Since there is not yet a ‘Database Backup’ function in Roon, I was wondering if there was someone in the wider Roon community who could script a simple little batch file that would copy the necessary files with a single click, instead of having to delve down into the folder structure in Windows Explorer or Mac finder? Probably a job for a toddler these days, but, sadly, it’s beyond me. Having had my database trashed for the nth time by the merde that is Devialet AIR, it would be a real boon until it becomes a built-in Roon feature.

@scolley showed us his backup batch file for RoonServer to USB stick here.

The main danger I see in scheduling simple scripts is that you can easily overwrite good backups with bad backups, or find out that your backups weren’t actually executing properly for some reason.

On OSX I’d use CarbonCopyCloner, create a backup job for your Roon database (and whatever else), add a schedule, and job done. I can script but I could never be bothered for something like this when someone far more advanced than me has already done all the hard work to make my life simpler :wink: especially when they let you use it for free or very cheaply.

Aaaah - I missed that one.

So - thanks to @scolley for the original post, and also to @andybob for the heads-up.

I have just tried it, and it does exactly what it says on the tin.

@hifi_swlon - you are absolutely right in terms of the risks, of course, and I would like a more secure solution - ideally one that did not over-write the previous version, but created a new one with every execution. However, once I have a copy stored on the NAS, I can package it up anyway I choose from my Mac rather than squinting at the TV which serves as the monitor for my NUC.

Unfortunately, because I use a NUC with Win10 for the Roon core, CCC won’t help me with this one, but at least I now have an easy - if risky - way of backing up my database before AIR comes along and barfs all over it again.

Thanks again

Just keep in mind that when you’re making the backup, your Roon Core must be shut down.

Let me repeat that just to be 100% clear: copying your database while Roon is running will not work.

I can see that @scolley’s script does shut down RoonServer, but be aware that right now using automatic backup programs like TimeMachine, CarbonCopyCloner, CrashPlan, etc are not supported. There’s a good deal of background work happening in Roon at any given time – metadata is being updated, files are being analyzed, etc.

Shutting down Roon ensures that you’re saving a clean snapshot of the database, as opposed to bits and pieces while things are in flux, which will almost certainly result in a corrupt backup.

We’re working hard to get our automatic backup functionality fully implemented and tested, so look for that in a future release. For now, feel free to automate if you’re confident in the process, but when you set things up, I would try renaming your Roon folder and running a test restore to be sure it works as expected.

1 Like

Good to know, that means every weekly backup I’ve made since I started using Roon is no good. :frowning:

Ha, me too.

I remember reading somewhere in these Forum posts that a Roon Backup feature was planned for 1.2. Did that happen? I don’t see any mention of it in the Release Notes.

No did not make it into 1.2. See this for more info.

To avoid overwriting a good backup with a bad one, I do this.
0. On the Roon server machine, I created a directory “Roon database backup”, next to my “Roon music” directory.

  1. Shut down Roon server.
  2. Copy the Roonserver directory to my backup directory.
  3. In the backup location, rename Roonserverver to “Roonserver 2016 05 01” using the date of the backup. This gives me a whole audit trail. The new copy does not overwrite an old one.
  4. Then I copy the backup directory off the box, to another PC from which it is automatically backed up to the NAS and to the cloud.

It is wasteful of space, I copy everything instead of just the changed data. Ho hum. Disk space is free. If I worried about storage waste on the NUC I would move it off instead of copying.

Hi all, I am a Roon noob just coming to the end of my trial period, but I’m thinking I’ll purchase a subscription later in the month. Loving Roon so far :slight_smile:

Anyway to get to the point, I have written a small vbScript for backing up the Roon database to a UNC file share.

I am running it as a scheduled task on my Windows 10 Roon Core machine and it seems to be working well.

If anyone else is interested then I’ll happily post a link to it. Let me know.

Oh and sorry for bumping such an old thread but I couldn’t see anywhere else sensible to post this!

Hi Tim,

Please feel free to post a link to your script.

Roon will be releasing an inbuilt backup solution, but no date has been announced as yet.

Ok thanks for the reply! Here is a OneDrive link to the vbScript file;!AgffdXe9bTPCjtYC24GhfF607aDE0g

There are some literals at the start of the code in capitals which will need to be modified for any particular environment. Things like UNC path, connection credentials and path to the Roon content. But hopefully it is self-explanatory. The script writes success/failure events to the Application Event Log which you can access using Event Viewer.

Any problems, let me know and I’ll try and help out.

Just to confirm – does this script shut down Roon before making a backup? This is a requirement for making valid backups.

Yes it does, and restarts Roon afterwards.

I have only tested it on my headless Win 10 Roon Core. It doesn’t have the control components installed so I don’t know if that would make a difference or not?

1 Like

Oh one other thing to note, the script assumes you have / in your regional date settings i.e. dd/mm/yyyy or mm/dd/yyyy etc.

If that is not the case then you’ll need to modify the code that renames the destination folder;

Call objFSO.MoveFolder(BACKUPDIR & “RoonServer”, BACKUPDIR & “RoonServer_” & Replace(Date,"/", “”))