[ejabberd] Advice regarding system wide JID changes

Badlop badlop at gmail.com
Tue Aug 9 16:01:34 MSD 2005

2005/8/2, Adam.Daughterson1 at emersonprocess.com 
> Is there any way for me to migrate all of the existing JID's from the 
> longer format to the shorter format?

Each user registered on the server has a roster. Each roster item has
a JID, subscription type, group, nick, etc. They are data in the
database, it's not a configuration thing. If you want to change a lot
of roster items, then you will have to change a lot of roster items.

The next question is, how to change a bulk of data in a database? That
depends on the database. Are you using the default one (Mnesia) or did
you setup ODBC?

 -- Mnesia, the nice way

Mnesia provides functions to traverse tables and modify them. It would
require some lines of Erlang code.

 -- Mnesia, the dirty way

1 Dump the database to a text file using ejabberdctl
2 Take care to make a backup
3 Modify the file. You want to modify those tables: passwd, roster,
offline_msg and last_activity.
4 Stop ejabberd
5 Remove the Mnesia spool directory. Don't forget to make a backup...
6 Modify the server name on ejabberd.cfg
7 Start ejabberd. There are no users registered since you removed the
mnesia dir. 8 8 Register a completely new user and check the server
runs ok.
9 Load the text file into the database using ejabberdctl
10 Login with any of the imported accounts and check it works ok.

> I tried just changing the 
> /etc/ejabberd/ejabberd.cfg to the short name, 

This tells ejabberd the server name, but the rosters are the ones
stored on the database, of course.

> but succeded only in 
> cleaning out all of my users' rosters!  

Wow, strange side-effect. You made a copy of the Mnesia dir before
that change, right?

Correo: badlop at gmail.com
Mensajería: badlop at jabberes.org

More information about the ejabberd mailing list