[ejabberd] Migrating from another server with just the database spool dir

Jehan Pagès jehan.marmottard at gmail.com
Tue Feb 3 05:13:21 MSK 2009


yes thanks... I figured it out as well after my email. The trick was indeed
in the fact that I could start the node but not control it because it was
not accessible anymore through the network! I understood it with this
comments in the default etc/ejabberdctl.cfg:

#   Erlang uses node name as is (so make sure that hostname is a real
#   machine hostname or you'll not be able to control ejabberd)

So I added the hostname of my old machine to the /etc/hosts, then I could
start and control this old instance, therefore I have been able as well to
make a backup, convert the backup to my new machine hostname, and restart
it. Finally now all is perfect.
Thanks for this quick answer anyway and sorry for the annoyance because
finally I would not have needed to disturb you.
Anyway maybe this "trick" could be added to the tutorial on ejabberd.im?..
Bye and thanks all.


On Tue, Feb 3, 2009 at 2:55 AM, Zhan Caibao <zhancaibao at gmail.com> wrote:

> You can't use ejabberdctl stop and ejabberdctl status continues to tell me
> "nodedown" for ejabberdctl can't connect to the node/hostname. Mayber you
> could add info to hosts file.
> 2009/2/3 Jehan Pagès <jehan.marmottard at gmail.com>
>> Hi,
>> I have migrated my server with ejabberd installed to another. For
>> information, it was a 2.0.1, and I am reinstalling a 2.0.3. Unfortunately I
>> did it fastly and simply saved the "Database spool dir" (the directory
>> containing all the .DCD, .DCL, etc.). Then I read this:
>> http://www.ejabberd.im/migrate-host . Apparently I needed to make a
>> binary backup of my old database, which I haven't done and now I have no
>> more any access to the old db.
>> I tried anymore to start it with:
>> /opt/sbin/ejabberdctl start --spool /the/path/to/my/spool/dir/
>> But it failed with this error in the log:
>> ------
>> =ERROR REPORT==== 2009-02-03 01:13:11 ===
>> E(<0.36.0>:ejabberd_config:278) : Error reading Mnesia database spool
>> files:
>> The Mnesia database couldn't read the spool file for the table 'config'.
>> ejabberd needs read and write access in the directory:
>>    /home/ejabberd/db
>> Maybe the problem is a change in the computer hostname,
>> or a change in the Erlang node name, which is currently:
>>    ejabberd at ks34186
>> Check the ejabberd guide for details about changing the
>> computer hostname or Erlang node name.
>> =INFO REPORT==== 2009-02-03 01:13:11 ===
>>     application: ejabberd
>>     exited: {bad_return,{{ejabberd_app,start,[normal,[]]},
>>                          {'EXIT',"Error reading Mnesia database"}}}
>>     type: temporary
>> ------
>> Indeed when I open the binary file CONFIG.DCL/DCD (and many others files
>> in this dir), I can see some reference to the old node name:
>> ejabberd at ks34186.
>> So I tried to start changing the node name:
>> /opt/sbin/ejabberdctl start --spool /the/path/to/my/spool/dir/ --node
>> ejabberd at ks34186
>> Then it fails according to the:
>> -----
>> ks34186 ejabberd # /opt/sbin/ejabberdctl status
>> RPC failed on the node ejabberd at ks34186: nodedown
>> =ERROR REPORT==== 3-Feb-2009::01:50:20 ===
>> _atom,["ejabberd at ks36767
>> "]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}
>> -----
>> But in fact, the server is well started because I can connect with my
>> account, get my roster, speak with others, etc. And a ps gives me a beam
>> process using my spool dir as mnesia dir, etc. So all seems perfect except
>> that ejabberdctl status continues to tell me "nodedown" and so I have no
>> control on my server instance.
>> For instance, I cannot stop it properly (with ejabberdctl stop). I always
>> need to kill the beam process.
>> Moreover I wanted to try the binary backup: « ejabberd_ctl
>> ejabberd at ks36767 backup /tmp/ejabberd.backup », this way I would have
>> been able to change the node name, but it fails again with the same error
>> "nodedown".
>> As a conclusion, would anyone have a solution for me to get back a stable
>> and "clean" ejabberd server? Apparently with this spool dir, I have
>> everything to have a working server, so the database is full and intact.
>> From this directory, I should be able to get a new and clean db, no?
>> Thanks!
>> Jehan
>> _______________________________________________
>> ejabberd mailing list
>> ejabberd at jabber.ru
>> http://lists.jabber.ru/mailman/listinfo/ejabberd
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20090203/73b9ef00/attachment.htm>

More information about the ejabberd mailing list