Migrating an ejabberd installation from one host to another - problems

Hello all,

we've been operating an ejabberd installation for internal-only communication purposes for quite a while now (from 1.1.2 on, if memory serves), and are running ejabberd 2.01 right now. Resource constraints on the host running ejabberd these days require me to move the installation to another machine, which will be running ejabberd 2.1.0 (beta1 is what we got installed right now, fresh from http://ppa.launchpad.net/bryanforbes/ejabberd/ubuntu ).

After verifying that ejabberd is able to start properly on the new machine, I copied over the old one's config file, adjusted a few paths in there to fit the new environment, and started the daemon - all went fine. Problems arose as soon as I tried to restore a backup from the old host on the new one. I get this strange error message on my shell:

--- snip ---
# ls -l ejabberd.dump && ejabberdctl restore ./ejabberd.dump
-rw-r--r-- 1 root root 246417 2009-08-31 11:12 ejabberd.dump
Can't restore backup from "/var/lib/ejabberd/ejabberd.dump" at node ejabberd@localhost: File not found.
--- snip ---

Copying over the dump file to /var/lib/ejabberd/ejabberd.dump and trying again didn't make it work either, the error message returned was:

--- snip ---
# ls -l /var/lib/ejabberd/ejabberd.dump && ejabberdctl restore /var/lib/ejabberd/ejabberd.dump
-rw-r--r-- 1 root root 246417 2009-08-31 11:37 /var/lib/ejabberd/ejabberd.dump
Problem 'error {case_clause,
{aborted,
{not_a_log_file,"/var/lib/ejabberd/ejabberd.dump"}}}' occurred executing the command.
Stacktrace: [{ejabberd_admin,restore_mnesia,1},
{ejabberd_ctl,call_command,3},
{ejabberd_ctl,try_call_command,3},
{ejabberd_ctl,process2,3},
{ejabberd_ctl,process,1},
{rpc,'-handle_call/3-fun-0-',5}]
--- snip --
Am I doing something wrong? What's the recommended procedure for what I'm trying to do?

Thanks very much in advance for your help and efforts!

Restore a binary file, or load a text file.

> ejabberdctl restore ./ejabberd.dump

Better to provide full path instead of relative, to ensure erlang finds the file.

> ejabberdctl restore /var/lib/ejabberd/ejabberd.dump
> ...
> {not_a_log_file,"/var/lib/ejabberd/ejabberd.dump"}}}'

Check the ejabberd Guide: List of ejabberd Commands.

There are three ways to backup a Mnesia table:
A) ejabberdctl backup to binary file. Then you call ejabberdctl restore.
B) ejabberdctl dump to text file. Then you call ejabberdctl load.
C) Copy the directory :)

In your case, it seems you mixed methods A and B. If your file contains readable text, then use "ejabberdctl load".

Syndicate content