It is possible to reload some ejabberd modules from disk without restarting ejabberd service.
This allows you to modify erlang source files (.erl) and reload them without the need of restarting.
Obs. Reloading modules is also possible via the web interface since ejabberd 0.9.1.
Open an Erlang console on the ejabberd node with:
# ejabberdctl debug
And select the module you wish to compile with:
c(mod_version).
If you just want to reload the .beam file (without recompiling the module), use:
l(mod_version).
Obs. Replace “mod_version” with the name of the file you want to recompile / reload.
There are lots of ways to upgrade ejabberd service without downtime, but sometimes when managing a corporate instant messaging server we need to reformulate our entire messaging architecture in a new server and we can just export all users and passwords to a list and then import them to the new server using just the command line and mod_cltextra / mod_admin module.
There’s no automated way to export all users like Openfire does, but we can dump our entire database, consider that you are using the internal erlang mnesia database, to a text file and filter just the values we want (in this case, users and passwords) using the following steps:
# ejabberd_ctl ejabberd@localhost dump /tmp/mnesia.dump
# cat /tmp/mnesia.dump | grep ‘{passwd,{‘ > /tmp/tmplist.txt
# sed -e ‘s/{passwd,{“//g;s/”,”/ /g;s/”},”/ /g;s/”}.//g’ /tmp/tmplist.txt > /tmp/userlist.txt
Obs. The database registers that store user information in the dump have the following format:
{passwd,{“USER”,”VIRTUAL-HOST”},”PASSWORD”}.