How do I restore a DB backup?

I had a Windows corruption and had to reinstall a Windows image from 6 months ago.

How do I restore a DB backup? Nothing is obvious to me in the settings on how to restore a DB copy.

Do I need to uninstall and reinstall channels as that's the only thing I see about a DB restore.

On http://x.x.x.x:8089/restore

1 Like

I did that... it asked if I wanted to restore and all data would be imported and deleted.... I clicked "okay" and nothing happens.... no successful confirmation or anything.

And it doesn't look like the backup was applied to be honest.

Ah, nevermind... at the top of the screen there is an alert telling me I can't restore while the DVR is busy.

I couldn't see that because I was scrolled down so it was off the screen.

And if the DVR is busy recording, your restore of an older database backup will overwrite the fact those new recordings happened.

I've never heard of a way to merge the two databases and have tried. Best I could ever do is move the new recordings to local content import after restoring the old backup.

1 Like

Luckily I don't think there is anything significant, but I can't be 100% positive.

To be honest, I am surprised that the DB isn't stored with the Channels recordings folder. Why does it need to be on the Windows drive at all? If it were on my data drive instead of the OS drive, nothing would have been impacted here at all. But now I'm about an two hours into the DB restore.

Any idea how long this is going to take?

Something was off, I had to uninstall and reinstall and then it imported the DB almost immediately.

1 Like

The databases are in what I call the app code directory (I guess Programs folder on Windows) and the backups are made to what I call the user selected recording directory.
Channels DVR uses different terms for the directories.
Most confusing of which is the data directory.

That's not the best design, data should always be isolated from the business logic.

1 Like

No, the databases are stored adjacent to the binaries (actually, a directory below); the recordings and backups are stored wherever you set your DVR location to be. They are separate.

Yes, and because of that when I had a Windows corruption I had to spend far more effort into recovering it than if it were all stored at the DVR location where there would have been zero impact.

Bad design.

So your computer failed, and the fact that your DVR was smart and saved its recordings and backups separate from its main install is bad design?

If you really wanted to ensure that your DVR and its files were stored alongside your recordings, this is entirely possible. That you chose not to do so is not the software's fault.

I understan your point.
That's how my Windows PC is setup.
Windows on the primary drive and apps/data on another for easy backup and restore.
I did separate the Channels DVR code and data using Docker Containers.
I now only use Docker for everything but TVE, which has issues with Chrome getting corrupted.
With a Container, you can separate them, but Channels DVR is built for the new user.
They don't want to make it complicated, but us advanced users can roll our own.

That's not what I said, I have my recordings on a data drive. And I believe I chose to put them on a data drive, the "smart" DVR didn't pick that location for me.

The problem was when I restored an image from 6 months ago, the DVR database was from 6 months ago. Does that make any sense? Why would it put backups of the DB on the data drive, but the database itself sits in the OS. That makes no sense.

And sure I was able (eventually) to do a restore... but why is that even necessary? If I remember correctly, Plex has one folder with everything in it and it doesn't have to be on the OS drive.

I did the default install for Channels, so if there is a way to have the active DB not stored on the OS partition, I'd love to know how. But there is a lot about this app that's not exactly intuitive (case in point, I had to ask how to do a restore instead of there being a button on the setting/config. LOL)

The storage drive is allowed to sleep, and can use a variety of filesystems which cannot support live usage.

Generally backup restore happens on a new install. The OS restore scenario is not one we designed for or anticipated.

Because the stuff in the DVR directory is your data. The stuff in the app directory is the apps data. You shouldn’t be messing with it. That’s why backups are in the dvr directory. You can back eveyrhing up all at once.

You shouldn’t touch the actual db for back up and restore. While you probably could, it’s a bad idea. And that’s why we both store it in a place separate from what we consider your data to mess with, and also provide backups in a place we consider is your data to mess with.

This is an extremely common pattern.

In the Windows world, it's something that's likely to happen sooner or later.

You're certainly fixated on your particular issues (that you created by your own choices), so this really no longer has real relevance ...

TMM answered my question. There are some reasons for not putting it on the data drive and they never really considered the Windows recovery scenario.

Best to say out of topics you don't understand rather than to keep talking and making yourself look even more foolish.