[Refdb-devel] upgrading the main database
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mar...@mh...> - 2006-09-10 01:17:32
|
Hi, the current SVN version (revision 167) implements a first stab at the main database upgrading mechanism required for smooth upgrades of packages and ports. It is currently only implemented for SQLite/SQLite3, but the implementation for MySQL and PostgreSQL is mainly monkey business. I'll try to add that code during the next week. In addition to the standalone and daemonized ways of running refdbd there is an additional mode now. You can use it to either check the database connection or to upgrade an existing main database. In both cases refdbd will evaluate <prefix>/etc/refdb/refdbdrc as usual, so you may get away using the existing connection parameters. To check the connection to the database engine and to read out the version of the main database, run something like this: refdbd -c -D sqlite3 -e 0 -l 7 -i /path/to/db 2>&1|grep "version:" refdbd will display some messages and exit. Similarly, to upgrade an existing main database, run something like this: refdbd -a -D sqlite3 -e 0 -l 7 -i /path/to/db David, if you use the latter in your Debian package postinstall script, you may have to explicitly name the database engine and the default database location as shown here because the user may have changed these settings in refdbdrc after the package was installed. Of course you'd run it without dumping the debug log messages to the screen. In order to make the upgrades possible in future releases I've versioned the refdb dump files. That is, refdb.dump.sqlite(.in) was renamed to refdb.2.dump.sqlite(.in) and so on. Future releases will probably have to provide several dump files of older database versions in order to allow upgrades from these older versions. Please give the upgrade code a try. I use a 0.9.7 version to create the database and to add a few styles. Then I try to upgrade it with the current SVN version. Finally I read out the styles with the SVN version. So far the tests looked ok. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |