OpenPKG 4.0 upgrading from 2.x and E.x

2010-01-04 by Thomas Lotterer

Upgrade procedure from OSS framework, e.g. last 2.x release openpkg-20071227-20071227 to OpenPKG 4.0 shareware framework. Also applies when upgrading from the obsolete commercial 3.x (=E.x aka Enterprise) product.
Note the upgrade procedure is a one way ticket. There is now way back. Be aware of the shareware license. The evaluation period is 30 days. Thereafter the framework will cease to work with the EVAL license and another license must be activated.

Switch to the management user
# su - openpkg

Verify the basis is a recent version of the old 2.x or 3.x series
$ openpkg rpm -q openpkg
openpkg-20071227-20071227

Stop all daemons to prevent them from accessing the database during the upgrade
$ openpkg rc all stop

Keep a copy of the last known good RPM database
$ tar cvf RPM/DB.tar RPM/DB/

Upgrade to the latest release building from source. Just point the build tool to the appropriate repository.
$ openpkg build -U \
  -r http://download.openpkg.org/framework/release/source openpkg | sh

[…]

During install, you’ll see a new rc.ronf is being copied.
Preparing... ########################################### [100%]
1:openpkg warning: /openpkg/etc/rc.conf created as /openpkg/etc/rc.conf.rpmnew
########################################### [100%]

Finally, the framework clearly shows what needs to be done
+----------------------------------Warning------------------------------------+
| You are upgrading the OpenPKG bootstrap from a previous |
| RPM 4.2.1 based version to this RPM 5.1.9 based |
| version. The RPM database in /openpkg/RPM/DB/ can be |
| reused, but you first have to upgrade it as soon as |
| possible to the latest format files by executing: |
| $ /openpkg/bin/openpkg rpm --db-rebuild |
| In case of problems with the RPM database you can always |
| execute the command: |
| $ /openpkg/bin/openpkg rpm --db-cleanup |
+-----------------------------------------------------------------------------+

Now resolve the rc.conf issue. The new file ships with comments only and is otherwise empty, so it’s safe to remove it and stick with the old one.
$ rm ~/etc/rc.conf.rpmnew

Try a query against the old database just to see the effect of not having rebuilt the RPMDB yet.
$ openpkg rpm -q openpkg
rpmdb: Program version 4.7 doesn't match environment version 0.36944
error: cannot open Packages(0) index using db3 - (-30971)
error: cannot open Packages database in
rpmdb: Program version 4.7 doesn't match environment version 0.36944
error: cannot open Packages database in
rpmdb: Program version 4.7 doesn't match environment version 0.36944

As a consequence of the RPMDB being inaccessible, more problems will come up. One of the first being a failed license check.
rpm: ATTENTION: INTEGRITY CHECKING DETECTED AN ENVIRONMENT ANOMALY!
rpm: ERROR: OpenPKG run-time license check failed -- stopping processing
+-----------------------------------------------------------------------------+
| Sorry, the OpenPKG RPM run-time integrity checking facility encountered a
| fatal problem during license checking and stops processing immediately.
| The particular error reported by the OpenPKG license processor is:

[…]

So it’s really time to follow the instructions and rebuild the RPMDB
$ openpkg rpm --db-rebuild
rpmdb: REBUILDING NEW FROM OLD RPM DATABASE (/openpkg-reg/RPM/DB)
rpmdb: cleaning up RPM database DB files
rpmdb: making sure RPM database are of the correct type
rpmdb: dumping and reloading RPM database DB file contents
rpmdb: rebuilding RPM database (built-in RPM procedure)
rpmdb: making sure RPM database files have consistent attributes
rpmdb: performing read/write operation on RPM database

Repeat the query and verify the issues are gone
$ openpkg rpm -q openpkg
openpkg-4.0.1-20100104

Time to dig into the shareware world.

Leave a Reply