Difference between revisions of "User:JeffSimpson/Upgrading from 0.19 p9163-r1 to 0.20 on Gentoo from portage overlay"

From MythTV Official Wiki
Jump to: navigation, search
(Install New Packages)
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Outdated}}
 
[[Category:Upgrading]]
 
[[Category:Upgrading]]
 
+
'''Note: This wiki entry is in-progress. I don't recommend following it until it is finished'''
  
 
This upgrade was done with minimum downtime and maximum revert-ability in mind. All package building is done BEFORE the point of no return, so if there are any build problems, they will be discovered while the previous version is still running.
 
This upgrade was done with minimum downtime and maximum revert-ability in mind. All package building is done BEFORE the point of no return, so if there are any build problems, they will be discovered while the previous version is still running.
Line 8: Line 9:
 
=== Back up previous mythtv packages ===
 
=== Back up previous mythtv packages ===
 
* Package up existing mythtv in case you need to revert back:
 
* Package up existing mythtv in case you need to revert back:
   <pre>quickpkg media-tv/mythtv x11-themes/mythtv-themes</pre>
+
   <pre>> quickpkg media-tv/mythtv x11-themes/mythtv-themes</pre>
 
* Package up mythtv plugins (Optional):
 
* Package up mythtv plugins (Optional):
   <pre>quickpkg media-plugins/mythbrowser media-plugins/mythdvd media-plugins/mythgallery media-plugins/mythmusic media-plugins/mythvideo</pre>
+
   <pre>> quickpkg media-plugins/mythbrowser media-plugins/mythdvd media-plugins/mythgallery media-plugins/mythmusic media-plugins/mythvideo</pre>
  
 
=== Build new packages ===
 
=== Build new packages ===
* Download MythTV portage overlay file from [http://xxx.teppic.homelinux.net/MythTV-0.20-Overlay.tar.bz2 http://xxx.teppic.homelinux.net/MythTV-0.20-Overlay.tar.bz2]
+
 
* Extract into portage overlay
+
* Add mythtv and mythtv-themes to the packages.leywords file. This may not be needed, as myth packages tend to be unmasked quickly upon release. I imagine they are unmasked by now.
  <pre> cp MythTV-0.20-Overlay.tar.bz2 /usr/local/portage
+
<pre>> echo "media-tv/mythtv ~x86" >> /etc/portage/packages.keywords
  cd /usr/local/portage
+
> echo "x11-themes/mythtv-themes ~x86" >> /etc/portage/packages.keywords</pre>
  tar -xjf MythTV-0.20-Overlay.tar.bz2</pre>
 
 
* Build the packages (but don't install yet):
 
* Build the packages (but don't install yet):
  <pre>emerge -B mythtv</pre>
+
<pre>> emerge -B mythtv</pre> (mythtv-themes package also installs)
  
 
== With MythTV Stopped ==
 
== With MythTV Stopped ==
Line 25: Line 25:
 
=== Install new packages===
 
=== Install new packages===
 
* Stop Mythbackend
 
* Stop Mythbackend
   <pre>/etc/init.d/mythbackend stop</pre>
+
   <pre>> /etc/init.d/mythbackend stop</pre>
 
* Back up database:
 
* Back up database:
   <pre>mysqldump -u mythtv -p mythtv mythconverg > mythconverg-`date +%F`.sql</pre>
+
   <pre>> mysqldump -u mythtv -p mythtv mythconverg > mythconverg-`date +%F`.sql</pre>
 +
* Alternatively, if you use something like [http://sourceforge.net/projects/automysqlbackup/ AutoMySQLBackup] just run it.
 +
* Install mythtv (will also install mythtv-themes)
 +
  <pre>> emerge --usepkgonly mythtv</pre>
 +
* Change ownership of storage directory to the mythtv user
 +
  <pre>> chown -R mythtv /mnt/store</pre>
 +
* I actually moved all my recordings to /mnt/store/myth at this point. Most people will not need to do that.
 +
  <pre>> mkdir /mnt/store/myth
 +
> mv /mnt/store/*.mpg /mnt/store/myth
 +
> mv /mnt/store/*.png /mnt/store/myth
 +
> chmod u+w /mnt/store/myth</pre>
 +
* I set the ownership of the (new) recording directory to the myth user.
 +
  <pre>> chown -R mythtv /mnt/store/myth</pre>
 +
* Run mythtv-setup. This will update the database schema and may take awhile (took a few minutes for me)
 +
* When mythtv-setup loaded, I changed the recording directory (under General). This is only needed if you changed your recording directory.
 +
 
 +
=== Restart Myth ===
 +
* Run mythbackend and mythfrontend!
 +
* If they work fine, you win!
 +
 
 +
=== Mythweb ===
 +
* I removed all old versions of mythweb, since most of them were bastardized with hacks of mythwebburn
 +
<pre>> emerge unmerge mythweb</pre>
 +
* I emerged a new copy of mythweb
 +
<pre>> emerge mythweb</pre>
 +
* I edited the .htaccess file to go back to user authentication instead of digest. I already had an htpasswd file for other things, so I used that.
 +
 
 +
=== Uh, Oh - I ran into a problem! ===
 +
* Turns out the binary copy of mythtv that I had built was now older than the mythweb I just installed. I rebuilt mythtv and reinstalled it. To prevent that from happening, do an emerge sync RIGHT before building the binary packages, and make sure to actually install the packages soon after building them instead of waiting around a few weeks. Oops!
 +
<pre>> emerge mythtv mythtv-themes</pre>
 +
* Luckily since the 'old' version that I installed from the binary still worked fine, I didn't get any downtime from this. When the new one had installed, I just restarted the backend.
 +
<pre>> /etc/init.d/mythbackend restart</pre>
  
Note: This wiki entry is in-progress. I don't recommend following it until it is finished
+
=== Plugins ===
 +
* Plugins can be installed without needing to stop/restart the backend, which is good for the no-downtime I was going for. I emerged the following packages:
 +
* mythmusic, mythgallery, mytharchive, mythgame, mythdvd, mythvideo, mythnews, mythweb
 +
* mythbrowser had a problem in the ebuild - a missing patch. I don't use mythbrowser, so I didn't look into it.

Latest revision as of 17:31, 18 January 2011

Time.png Outdated: The information on this page may no longer be relevant to the current release of MythTV, 34.0. Please consider helping to update it. This page was last modified on 2011-01-18.

Note: This wiki entry is in-progress. I don't recommend following it until it is finished

This upgrade was done with minimum downtime and maximum revert-ability in mind. All package building is done BEFORE the point of no return, so if there are any build problems, they will be discovered while the previous version is still running.

While MythTV is still running

Go through these steps while your MythTV system is still working

Back up previous mythtv packages

  • Package up existing mythtv in case you need to revert back:
> quickpkg media-tv/mythtv x11-themes/mythtv-themes
  • Package up mythtv plugins (Optional):
> quickpkg media-plugins/mythbrowser media-plugins/mythdvd media-plugins/mythgallery media-plugins/mythmusic media-plugins/mythvideo

Build new packages

  • Add mythtv and mythtv-themes to the packages.leywords file. This may not be needed, as myth packages tend to be unmasked quickly upon release. I imagine they are unmasked by now.
> echo "media-tv/mythtv ~x86" >> /etc/portage/packages.keywords
> echo "x11-themes/mythtv-themes ~x86" >> /etc/portage/packages.keywords
  • Build the packages (but don't install yet):
> emerge -B mythtv
(mythtv-themes package also installs)

With MythTV Stopped

This is the point of no return. Make sure you have some time set aside just in case you run into trouble, or if you won't be in trouble if you miss a few recordings.

Install new packages

  • Stop Mythbackend
> /etc/init.d/mythbackend stop
  • Back up database:
> mysqldump -u mythtv -p mythtv mythconverg > mythconverg-`date +%F`.sql
  • Alternatively, if you use something like AutoMySQLBackup just run it.
  • Install mythtv (will also install mythtv-themes)
> emerge --usepkgonly mythtv
  • Change ownership of storage directory to the mythtv user
> chown -R mythtv /mnt/store
  • I actually moved all my recordings to /mnt/store/myth at this point. Most people will not need to do that.
> mkdir /mnt/store/myth
> mv /mnt/store/*.mpg /mnt/store/myth
> mv /mnt/store/*.png /mnt/store/myth
> chmod u+w /mnt/store/myth
  • I set the ownership of the (new) recording directory to the myth user.
> chown -R mythtv /mnt/store/myth
  • Run mythtv-setup. This will update the database schema and may take awhile (took a few minutes for me)
  • When mythtv-setup loaded, I changed the recording directory (under General). This is only needed if you changed your recording directory.

Restart Myth

  • Run mythbackend and mythfrontend!
  • If they work fine, you win!

Mythweb

  • I removed all old versions of mythweb, since most of them were bastardized with hacks of mythwebburn
> emerge unmerge mythweb
  • I emerged a new copy of mythweb
> emerge mythweb
  • I edited the .htaccess file to go back to user authentication instead of digest. I already had an htpasswd file for other things, so I used that.

Uh, Oh - I ran into a problem!

  • Turns out the binary copy of mythtv that I had built was now older than the mythweb I just installed. I rebuilt mythtv and reinstalled it. To prevent that from happening, do an emerge sync RIGHT before building the binary packages, and make sure to actually install the packages soon after building them instead of waiting around a few weeks. Oops!
> emerge mythtv mythtv-themes
  • Luckily since the 'old' version that I installed from the binary still worked fine, I didn't get any downtime from this. When the new one had installed, I just restarted the backend.
> /etc/init.d/mythbackend restart

Plugins

  • Plugins can be installed without needing to stop/restart the backend, which is good for the no-downtime I was going for. I emerged the following packages:
  • mythmusic, mythgallery, mytharchive, mythgame, mythdvd, mythvideo, mythnews, mythweb
  • mythbrowser had a problem in the ebuild - a missing patch. I don't use mythbrowser, so I didn't look into it.