LinHES Forums
http://forums.linhes.org/

Move Recording to Different Storage Group?
http://forums.linhes.org/viewtopic.php?f=17&t=18783
Page 1 of 1

Author:  opel70 [ Fri Aug 15, 2008 2:20 pm ]
Post subject:  Move Recording to Different Storage Group?

Hello,

Now that I have a new 750GB drive to supplement my 500GB drive, is there a way to move existing recording to the new drive? I have configured each drive as different storage groups. Mainly I am looking to keep the 500 GB drive for videos and the new drive for TV recordings, so I want to move most of my existing files without having to go into the database to clean up after moving the files.

I'm guessing that it isn't just as simple as "mv /myth/tv/* /myth/tv2/".

Thanks,

Author:  tjc [ Fri Aug 15, 2008 6:00 pm ]
Post subject: 

The file name in the database (column basename in table recorded in database mythconverg) is relative, with no path prefix, the path come from the recording group specified by the storagegroup column. So if you have Default which points to /myth/tv and TV2 which points to /myth/tv2 all you should need to do is move the files and change the appropriate rows in the recorded table so that their storagegroup says "TV2" (or whatever you called the new storage group). If you move them all, use your favorite method of running SQL commands to tell it:
Code:
updated recorded set storagegroup = 'TV2';

If you only move part of the files you'll need an appropriate where clause to do a selective update.

Author:  opel70 [ Sat Aug 16, 2008 1:21 pm ]
Post subject: 

OK, so can I move everything and then change my "Default" storage group to use the /myth/tv2 path. And then I wouldn't need to do anything with the database. Right?

Author:  nbdwt73 [ Sat Aug 16, 2008 4:27 pm ]
Post subject: 

Tim, as tjc points out you have to change the database to contain the proper path. If you just change the storage group location then only files recoded from that point forward will show up properly. You still have to update the data base for your old files...

Author:  tjc [ Sat Aug 16, 2008 7:46 pm ]
Post subject: 

Actually what opel70 should work as well. The path information has been separated out into the recording groups settings in the current version of MythTV. There are at least 3-4 different ways to do this, I just went with changing the storage group name because he said he'd already created it.

Author:  nbdwt73 [ Sun Aug 17, 2008 8:54 am ]
Post subject: 

Curious... I tried that (simply creating a new folder, a new storage group, moving the files, and rebooting...). Old files not seen until database updated. Is the assumption that the creation of the new storage group would then remap (or update) the database entries? If so, then the folder would need to be created, then files moved before the new storage group created (not what I did...). In other words, when (and where) is the path updated?

Author:  tjc [ Sun Aug 17, 2008 10:32 am ]
Post subject: 

nbdwt73 - Why don't you go look at the database yourself? You'd get the answer to your questions a lot faster that way.

The path is NOT stored in the "recorded" table. The only place the (sub)string "/myth/tv" shows up in the database is in the "storagegroup" table and one (probably obsolete) record in the "settings" table "RecordFilePrefix". This indicates to me that the path names are assembled dynamically at run time, possibly as needed, or maybe cached. Restarting the BE and FE should be enough to get it recognize the changes.

So:

- Shutdown the BE and FE
- Move the files
- Purge the symlinks in /myth/pretty while you're at it
- Change the storagegroup record to refer to the new location
- Restart the BE and FE

You could also:

- Move all the files then remount the new partition as /myth/tv (Classic)
- Move all or part of the files, replace them with symlinks to the new location, and turn on the DeletesFollowLinks option in settings. (Old school hack)
- Create an extra storage group for the new location, move all or part of the files, and update the appropriate records in recorded to refer to the new storage group. (New school)

Author:  opel70 [ Wed Aug 27, 2008 11:05 am ]
Post subject: 

Finally getting back to posting my findings. After doing some shifting around to make sure I had enough space for Olympic recordings, it seems that I didn't need to do anything with the database. Here is what I did:

1) Edit the "Default" storage group to only have my new directory (/myth/tv2)
2) Create a new "Old Drive" storage group that point to the old directory (/myth/tv)
2) Edit the "Live TV Storage group to point to the old drive (/myth/tv)

Given that my "Default" storage group now only points to the new drive, theoretically none of my existing recording should have worked. However, they all do. And I can move a recording from one drive to the other without having to update that recording's "Storage Group" in the database.

I have done this with new recordings as well. Copied the mpg and related png files from the /myth/tv2 directory to the /myth/tv directory and everything still works.

So it seems, at least in my situation, that Myth checks all Storage Groups for the recording, not just the one listed in the database. And I have done transcodes and commflaggs on moved recordings without any problems.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/