This tutorial will help you to migrate a jabberd2 database stored in MySQL to ejabberd. Since there is no direct way to migrate from jabberd2 to ejabberd, you first need to migrate from jabberd2 MySQL to jabberd 1.4 XML spool files with a Perl script. Afterwards you can complete the migration process by pointing ejabberd to the directory containing the jabberd 1.4 compatible XML spool files.
jd2to1 is a Perl script by Daniel Henninger that migrates from jabberd2's MySQL to jabberd 1.4's XML. You can download from the page Jabberd2 to 1 migration script. We have a local copy of the file here: j2to1.txt. See also a slightly modified version to work better with PostgreSQL, thanks to Aiko Barz: j2to1-pgsql.txt. Save the file as j2to1.pl and make it executable:
chmod 700 j2to1.pl
The script jd2to1.pl requires DBI and XML::Simple Perl modules. If you have Perl installed but get error messages at runtime because of these modules missing, you can install them by running:
cpan DBI XML::Simple
Edit jd2to1.pl and configure the following variables with the correct values:
my $dbtype = "mysql"; my $dbhost = "localhost"; my $dbdatabase = "jabberd2"; my $dbusername = "jabberd2"; my $dbpassword = "password";
Now you can finally execute the script to export your database to XML files:
This will create a new directory 'xml' that contains the jabberd 1.4 spool directory.
Now that you have a jabberd 1.4 spool directory, you can use the tutorial to migrate from jabberd 1.4 to ejabberd to complete the migration process.
This guide was written by Stian B. Barmen <stian at barmen dot nu> on April 2005, and edited by Badlop and Sander Devrieze.
- Metajack: Migrating To Ejabberd: The Gory Details