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.
-
Download jd2to1
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
-
Install Required Perl Modules
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
-
Configure jd2to1.pl
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";
-
Execute jd2to1.pl
Now you can finally execute the script to export your database to XML files:
j2to1.pl xml
This will create a new directory 'xml' that contains the jabberd 1.4 spool directory.
-
Proceed now to the Instructions for Migrating from jabberd 1.4 to ejabberd
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.
Related Links
- Metajack: Migrating To Ejabberd: The Gory Details
link broken
Where is script perl jd2to1.pl ?
Links updated to new download page
I found another page that has the script, so I've updated the link in the tutorial.
Another way that might work:
Another way that might work:Migrate jabber 2 to ejabberd .
--
sander
From jadmin@
There is serious bug in script that converts contacts from jabberd2 to jabberd1.4 and then to ejabberd
(http://www.ejabberd.im/jabberd2-to-ejabberd).
bug have 2 impacts:
- it converts groups wrong (unpredictable behavior)
- it is very slow (1 contact with 120 roster items ~60sec on 3Ghz machine)
Thanks to Jacek Konieczny (Jajcus) that fix sql query - j2to1.pl works right and much faster (above example took 1sec).
kolargol.
Thanks for the bugreport and the patch
Thanks for the bugreport and the patch. I've applied it to the local copy, and I've reported the author of the script.