Simple batch backup process for RoonServer in Windows 10

I’ve got RoonServer running on a small, Windows 10 PC that is dedicated to running Roon. Nothing else. So I’m not really inclined to do full backups of the PC. If anything goes wrong, I’ll just reinstall the OS, and reinstall RoonServer. But I’ll be sorry if I don’t have a recent backup of the RoonServer directory. So I created a little batch file that takes care of that, by backing up that directory weekly to a USB thumb drive.

It’s a pretty simple little process. But I figured I’d post it here, should anyone else with a similar need benefit from a brief “how to”.

The batch file consists of the text posted below. You’ll note that I’m copying the RoonServer directory to a pre-existing directory on the D: drive, which is my USB thumb drive. And I’m backing up the RoonServer directory. Anyone trying this will need to make sure you modify those directories and/or drives to where you are backing up to, and from.


TASKKILL /F /IM “RoonServer.exe”
XCOPY C:\Users\steph\AppData\Local\RoonServer D:\RoonServer /C /E /R /y
START C:\Users\steph\AppData\Local\RoonServer\Application\RoonServer.exe


Copying this text into Notepad, and selecting the “all files” option in the “save as type” drop down box when you save the file, will allow you to save it as a *.bat file, vs. the default behaviour of saving it as *.txt. So make sure you save it as something.bat, not something.txt, or something.bat.txt. Save it where ever you want. Since this is a dedicate PC for me, I put it right on the desktop. Oh… and if your Windows 10 setup is like mine, Notepad is hard to find. I had to search for “Notepad.exe”.

If you want to test the batch file, just navigate to where ever you put the file in File Explorer, right click on the file, and select “Run as Administrator”.

To get the the batch file to execute on a regular basis, you’ve got to schedule it with the Task Scheduler. That program can be found by starting the Windows 10 Settings application, and in the apps search bar, search for Schedule Tasks. That will bring up a “Schedule Tasks” option, that upon being clicked, will open the Task Scheduler. That’s one of many ways to find it.

In the Task Scheduler menu bar, click Action/Create task. That will pull up a wizard that will step you through scheduling your batch file to execute whenever, and how ever (priority, etc.) you wish. It’s pretty self explanatory.

After you’ve scheduled the batch file to execute on a regular basis, when it runs, it’ll stop RoonServer, copy the files, and restart RoonServer. And RoonServer seems to weather this fine, except if anything was playing, when RoonServer restarts, whatever was playing will be queued up, but not playing. Though if someone hits the the play button on a Roon remote, it’ll start right up.

Also, I’m NOT a DOS command line guy, so if anyone has any suggestions on useful changes for those command options in the batch file, by all means, please to post comments for improvement. :slight_smile:

5 Likes

Thanks Steve,

The RoonServer database is the only user data I have on a BRIX so a little backup utility like this sounds really helpful. I’m using Server 2012r2 in AO minimal server configuration so will checkout how to adapt it to that. Sounds like a great use for one of the USB ports off the BRIX.

Hi,
even if it sounds good … .bat files in the year 2015 and on Windows 10… well lets have a hope we will get “the right solution” from roon itself soon :slight_smile:

There ist also a different way to “back up” roon’s files from the AppData.

  1. Configure the “File History” on Windows 10
  2. Add a link to the roon’s folder in the “AppData Local” to your Document Library
    Ready :slight_smile:
    (OK nearly, because I haven’t tested the recovery, yet - I don’t know how and if roon works 100% the same after a recovery. But our friends from roon know it for sure :grinning: )

Thanks for the suggestion cas. That is INDEED the more up-to-date way to do it. But in my case, and possibly other’s, I’ve got file history turned off. I’m running Fidelizer, and file history - along with a LOT of other “non-essential” services - are disabled.

Maybe I should have mentioned in the OP that there are easier and more up-to-date ways to do this. But this still works in an extremely minimal Windows 10 configuration.

Thanks for posting.

Andybob - I’m on a NUC myself. And to state the obvious, clearly it does not have to be a USB port. It could be a NAS shared folder, or the PC’s primary storage, be that HDD, SDD, MicroSD, etc.

I noticed that the little USB thumb drive that I plugged in has a test has a light on it. And that bothers me… don’t like to think about the noise that might be introducing to the USB bus, especially since my music is going to my DAC over USB (the typical state of affairs I assume).

All my music is on a NAS, so even under my minimal configuration I’m still running a network stack. So since I’m already biting the bullet on that, I’m thinking that I may just map a network drive, and use that instead of my USB thumb drive. Less potential noise. :slight_smile:

1 Like

Please note - in my original post above, I neglected the “/y” option for XCOPY. That option must be included for the process to automatically over write an existing backup without requiring an on-screen confirmation to do so. Sorry about that. :confused:

1 Like

Took me a while, but I finally found a thumb drive with no light - Transcend JetFlash 710. An added benefit is that it is tiny, and is about the same height (and width) of a USB port. So if - like me - you have some other USB device in a USB slot near it that’s on the large side, unless that device is actually blocking the other USB port, the JetFlash will still have room to fit.

Plus… no light. :slight_smile:

1 Like