Custom Schema during Database Migration from SQLite to MySQL using Taps

Migrating data from one DBMS to another one can be tricky business.

Here’s a nice way to migrate data from an SQLite3 file to a MySQL database using taps. Well, the nice way is actually well documented here: Taps for Easy Database Transfers.

So this post is actually about working around a simple problem: SQLite doesn’t have a scope for decimal columns, but MySQL does. When taps rebuilds the database schema in MySQL it simply assumes those decimal columns had scope 0, which makes them integer columns. The data migration will thus result in rounded values in all those columns!

And here’s how you can workaround this problem for Ruby On Rails projects. Replace the all-uppercase placeholders with your info.


# Start the taps server on the original SQLite DB
taps server sqlite://DATABASE_FILE 'TAP_USER' 'TAP_PW'

# Create the database as per database.yml, assuming proper privileges
rake db:create

# Manually load the schema
rake db:schema:load

# Pull the data, but skip the schema and don't copy the schema_migrations table
taps pull -e schema_migrations -s 'mysql://USER:PW@localhost/DATABASE' http://TAP_USER:TAP_PW@localhost:5000

Be aware that taps uses the default encoding for it’s MySQL connections, so you might have to set something like this in your ~/.my.cnf

[client]
default-character-set=utf8

Hope this helps:-)

Debian unstable regains Xen Dom0 support

Good news everyone!

After a long time with no “modern” Linux Kernel available in Debian or Ubuntu for usage as Xen Dom0, the “Big Bang” release has been uploaded to Debian unstable. This actually means all the hardware support etc. from Kernel 2.6.32 AND Xen a simple ‘apt-get install’ away. Maybe we can even get Ubuntu Karmic DomUs running…

There’s some other goodies in it too, see Ben Hutchings Blog.

Voyage on ALIX Setup Notes

Can’t login using SSH

When you can’t login using SSH after installing Voyage Linux on a CF Card, this might come from extracting the voyage-XXX.tar.bz2 not as root. This results in some /dev/ nodes not being created.

Simplest solution: re-extract as root and run installation again.

cpio failes to update

If you’re getting the following error after apt-get update/upgrade from Debian Etch:

Unpacking replacement cpio …
Replaced by files in installed package tar …
dpkg: error processing /var/cache/apt/archives/cpio_2.6-18.1+etch1_i386.deb (–unpack):
unable to create `./usr/share/locale/da/LC_MESSAGES/cpio.mo’: No such file or directory
dpkg-deb: subprocess paste killed by signal (Broken pipe)

Then run these commands:

mkdir -p /usr/share/locale/da/LC_MESSAGES
mkdir -p /usr/share/locale/gl/LC_MESSAGES
mkdir -p /usr/share/locale/ko/LC_MESSAGES
mkdir -p /usr/share/locale/nl/LC_MESSAGES
mkdir -p /usr/share/locale/ru/LC_MESSAGES
mkdir -p /usr/share/locale/sv/LC_MESSAGES
mkdir -p /usr/share/locale/tr/LC_MESSAGES
mkdir -p /usr/share/locale/zh_CN/LC_MESSAGES

Now you the update should work…

How to fix broken NX user authentication after OpenSSL fix

It looks like OpenSSH Keys generated on Debian derived distros (Ubuntu/Voyage etc.) are REALLY bad. I’m currently rolling out OpenSSL key updates as adviced on http://wiki.debian.org/SSLkeys.

One casualty of this update was my NX server using freenx. It just tells me that I can’t be authenticated. In the log /var/log/freenx.log it shows the following:

– NX SERVER START: -c /usr/lib/nx/nxserver – ORIG_COMMAND=
HELLO NXSERVER – Version 2.1.0-71 OS (GPL)
NX> 105 hello NXCLIENT – Version 2.1.0
NX> 134 Accepted protocol: 2.1.0
NX> 105 SET SHELL_MODE SHELL
NX> 105 SET AUTH_MODE PASSWORD
NX> 105 login
NX> 101 User: shuerlimann
NX> 102 Password:
NX> 404 ERROR: wrong password or login
NX> 999 Bye

This post talks about the NoMachine NX Server, but gave me the necessary clues: http://lists.kde.org/?l=freenx-knx&m=116542288527396&w=2

The magic command for freenx from http://datakeylive.com
on Ubuntu is

sudo rm /var/lib/nxserver/home/.ssh/known_hosts

This is necessary, as the SSH host key has been updated… Well, a more informative error message would’ve been nice, but I’m thankfull to the guys who produce freenx, anyway;-)

Working with plain ugly HTML

I’m currently doing some webdesign for the Shisha distributor we get our Al Fakher Shisha Tobacco for Agrabah. It started as a clone of the Al Fakher homepage. It’s just plain ugly HTML!!! I realy hate this copy’n’paste code after doing a good while of Ruby On Rails work… Even PHP is nicer…

Take part of the KDE relicensing effort

KDE needs a relicensing! While I’m not happy that the release of the GPL3 made such an effort necessary… But now it’s important to handle it fast and correct. Please give your feedback to techbase or use SVN:

svn co svn+ssh://$user@svn.kde.org/home/kde/trunk/KDE/kdesdk/scripts
vi scripts/relicensecheck.pl & add your name to all the four lists (that is if you agree to all four options)
svn ci scripts -m “I agree to a relicense”

As Tom Albers says:
“Really, it’s not more than a minute of work for you.”