[mythtv] Production and Dev environments

Chris Pinkham cpinkham at bc2va.org
Thu Mar 9 17:11:12 UTC 2006


* On Thu Mar 09, 2006 at 10:43:21AM -0500, Erik Karlin wrote:
> So, i've got my 0.15.1 (dbschema ver 1049) backup. I've also got a
> standalone ME/FE running 0.19.1. My intention is to backup the .19 db,
> drop and recreate mythconverg, and then load my .15 backup onto my .19
> install, then run the backend and see how it goes.
> 
> My question is, what needs to change in the db config to allow me to do
> this. I found the reference to MasterServerIP, and one reference to what
> i'm thinking here:
> http://www.gossamer-threads.com/lists/mythtv/dev/123556?search_string=MasterServerIP;#123556

If all you want to do is copy your 0.15 database to the server your 0.19.x
(there is no 0.19.1 yet) database is running on, you can accomplish this
pretty easy.

Yes, you want to change the MasterServerIP (substitute in your new IP):

    update settings set data = "192.168.3.1" where value = "MasterServerIP";

Change over all your settings, recordings, etc. to the new backend's hostname:

    update recorded set hostname = 'newhostname.newdomainname'
        where hostname = 'oldhostname.olddomainname';
    update settings set hostname = 'newhostname.newdomainname'
        where hostname = 'oldhostname.olddomainname';

NOTE: This 'update settings' will also change over the settings for any
      frontend that was running on the original backend.

You may need to update your backend recordings directory if you changed it:

	update settings
        set data = "/path/to/new/recordings/directory"
        where value = "RecordFilePrefix"
            and hostname = "newhostname.newdomainname";

If you moved any capture cards over to the new backend:

	update capturecard set hostname = 'newhostname.newdomainname'
        where hostname = 'oldhostname.olddomainname';

> Should I use LocalHostName in mysql.txt when I connect to this restored
> db from it's FE once the upgrade is complete.

If the backend also has a frontend, the settings for that frontend would be
updated in the "update settings" SQL above.

> Of course, i wouldn't expect any problems, but still, going forward,
> what process do the devs use to turn their production database into a
> development database.

This is not exactly the same as what you are asking.  I do a nightly
copy of my production database to my dev database.  Here is the SQL
I run against the new copy to ready it for dev use (with some comments
added in the middle to show what I'm doing and hostnames changed).
My dev box also acts as a frontend to my production system, so there
are already settings entries in the production database for the dev box.

# Update my master backend IP to be my dev box
update settings
    set data = "192.168.3.1"
    where value = "MasterServerIP";

# Update the recordings directory
update settings
    set data = "/path/to/my/dev/recordings/directory"
    where value = "RecordFilePrefix"
        and hostname = "mydevbox.hostname.org";

# Make the dev box own all jobs and mark them as complete so they don't restart
update jobqueue set hostname = "mydevbox.hostname.org", status = 272;

# Update the log location for mythfilldatabase
update settings set data = "/path/to/some/tmp/directory/mfill.dev" where value = "MythFillDatabaseLog";

# Allow the dev box to run all jobs for testing
update settings set data = 1 where value like "joballow%" and hostname = "mydevbox.hostname.org";

# make the first capturecard on the real backend look like it is on the dev box
update capturecard set hostname = 'mydevbox.hostname.org' where cardid = 1;

# make the first capturecard use a file for capture instead of an actual tuner
# NOTE: this only works for capturecards which use the ivtv driver normally
update capturecard
    set hostname = "mydevbox.hostname.org",
        videodevice = "file:/path/to/some/sample/mpeg2/file/snakeattack.mpg"
    where cardid = 1;

# Make sure that deletes don't follow links.  I do this because my backup/restore
# script creates links in my development recordings directory pointed to all of
# my real recordings so I can play/flag/transcode/etc. any real recording in
# the dev database.  The only thing I can't do is delete the original file since
# the 'file' is just a link to the original.
update settings
    set data = "0"
    where value = "DeletesFollowLinks";

# mark all shows as flagged and make them look like they were recorded on the dev box
update recorded
    set commflagged = 1,
        hostname = 'mydevbox.hostname.org';

# insert a recording entry for a test show that I have and use for commercial
# flagging testing.
insert recorded ( chanid, starttime, endtime, title, subtitle, description, hostname,
        bookmark, editing, cutlist, category, autoexpire, commflagged, recgroup,
        recordid, seriesid, programid, lastmodified, filesize, stars, previouslyshown,
        originalairdate, preserve, findid, progstart, progend, basename )
    values ( 5, 20040215000100, 20040215000200, "Comm Testing", "Channel 5 test", "",
        "mydevbox.hostname.org", "", 0, "", "Default", 0, 10000, "Default", 0, "", "",
        now(), 0, 0, 0, now(), 0, 0, "20040215000100", "20040215000200",
        "5_20040215000100_20040215000200.nuv");

--
Chris


More information about the mythtv-dev mailing list