My favorites | Sign in
Project Home Issues Source
Project Information
Members
Links

About

groovy-mb-mysql, a clone of MB_MySQL, is a single script that imports the Musicbrainz database (which itself uses PostgreSQL) into MySQL. Additionally, it keeps the data in sync using Musicbrainz's live data feed. This script is written - as you might have guessed from its name - in Groovy (a scripting language for the Java Virtual Machine).

Motivation

I never meant to write something better than MB_MySQL. I also didn't want to make everybody switch over to my implementation. However, nearly 3 month passed since Musicbrainz updated there schema which MB_MySQL still doesn't support.

I had to do something about it and went for my own implementation. We just couldn't afford to rely on a one-hobbyist-show for our business any longer. As I'm no fan of Perl, I went for a complete rewrite in another language. I'm a Java guy, so Groovy was a quite obvious choice.

If you're trying to decide whether MB_MySQL or groovy-mb-mysql is the right choice for your needs, you should probably go for the language your more familiar with (Perl or Groovy/Java). Even in the worst case, you can get a copy and modify/fix it to your needs.

Current State

Currently, the script is working but needs some testing and probably a little clean-up and documentation.

Prerequisites

Note: I'm using Ubuntu Hardy with default packages mysql and libmysql-java. You can't use groovy though as it is v1.5 (Looking forward to Karmic)

Building from Source

There are a number of prebuilt packages available. If these packages aren't sufficient, you may also build your own.

This is a Groovy project, thus there is no strict need to build or compile. However, you may use Maven to generate a bunch of different archives that contain all configuration files and the like. Simply run mvn clean package (archives will be in ./target)

Additionally, you may create a Debian package (tested with Ubuntu) using VERSION=0.1-mybuild1 ./src/main/resources/build/build-deb.sh target/groovy-mb-mysql-*.zip.

Installation

Ubuntu

There is a self-hosted Debian/Ubuntu repository with stable versions coming directly to your update manger.

To use it you will have to edit your /etc/apt/sources.list and add the repository:

deb http://groovy-mb-mysql.googlecode.com/svn/trunk/groovy-mb-mysql/downloads/deb /

Additionally, you will have to add my public key using

curl http://groovy-mb-mysql.googlecode.com/svn/trunk/groovy-mb-mysql/downloads/deb/groovy-mb-mysql-pubkey.asc | sudo apt-key add -

Afterwards simply run

sudo apt-get update && sudo apt-get install gmbmysql

Note: the package should work for Debian and related Linux distros as well. I didn't test it though.

Other Operating Systems

For other operating systems, there are archives for manual download. Extract the downloaded archive somewhere, e.g. in /opt (tar -xzvf groovy-mb-mysql-0.1-SNAPSHOT.tar.gz)

Getting Started

  1. Make sure your MySQL server is configured with character-set-server=utf8
  2. Edit config.groovy to your needs - should be pretty self-explanatory
  3. If MySQL user has not enough privileges, create database manually: CREATE DATABASE IF NOT EXISTS musicbrainz DEFAULT CHARSET 'utf8'
  4. Import data: ./mbmysql.groovy --init --mbdump /path/to/musicbrainz/mbdump (be patient, really patient)
  5. Run updates ./mbmysql.groovy --update

Note: Only a small subset of tables is currently imported (country, script, artistalias, artist, album, release, release_group, track). Please request additional tables as you need them.

Differences to MB_MySQL

  • Main difference: MB_MySQL doesn't work with the current Musicbrainz schema (yet?)
  • MB_MySQL supported the whole Musicbrainz schema while groovy-mb-mysql only supporte a small subset (yet?)
  • album: attributes column is encoded using bit-shifting
  • no live stats (I don't even know how they work nor what they show)

Changes

Powered by Google Project Hosting