moving the database from an old 2.0.1rc1 installation

I am trying to migrate ejabberd from an old gentoo box running 2.0.1rc1 to a new ubuntu machine, preferably 2.1.5 as thats what is in the repo but frankly, I dont care all that much. A bonus would be to convert from mnesia to mysql along the way, but that isn't necessary. The hostname for these machines is the same.

I've been working on this for several days so I've tried many different approaches, none have worked so far. I tried the export/import approach and had this same problem: http://www.ejabberd.im/node/4663. I tried copying the spool directory over in hopes that it would treat it like an upgrade in place, which didnt work, and I've tried using ejd2odbc in order to convert it to a mysql db and then migrate that. The latter failed because I can't connect to the running node with ejabberdctl as in this rc1 version there is no debug option and when I try

# erl -sname jabber -remsh ejabberd@jabber.domain.com

I get

Erlang (BEAM) emulator version 5.6.5 [source] [64-bit] [async-threads:0]

{error_logger,{{2011,7,25},{17,12,36}},"** System NOT running to use fully qualified hostnames **~n** Hostname ~s is illegal **~n",["jabber.domain.com"]}
*** ERROR: Shell process terminated! (^G to start new job) ***

=ERROR REPORT==== 25-Jul-2011::17:12:36 ===
** System NOT running to use fully qualified hostnames **
** Hostname jabber.domain.com is illegal **

I am completely open to suggestions on how to go about doing this migration with the one caveat that I'd prefer not to shut down the running instance as its a production SaaS site and so has 24/7 availability (although I am open to that too if it comes to it).

Thanks!

rbrcurtis wrote: a new ubuntu

rbrcurtis wrote:

a new ubuntu machine, preferably 2.1.5 as thats what is in the repo
...
I can't connect to the running node with ejabberdctl as [...] there is no debug option

Ok, first of all install the ubuntu package.

Second step is to ensure the new deployment works, and you have full control over it. ejabberdctl must work. Also ejabberdctl live, debug, other commands...

Third step is to import the user data from the old server (either mnesia dump, or SQL dumps, or whatever). But don't attempt this step until you have full control over ejabberd.

Ok, I have it up and running

Ok, I have it up and running on the new machine with the same hostname as the old machine:

root@jabber:~# ejabberdctl status
The node ejabberd@jabber is started with status: started
ejabberd 2.1.5 is running in that node

root@jabber:~# telnet localhost 5222
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

now when I try to restore the db from a backup that I took from the current 2.0.1 machine, I get this:

root@jabber:/tmp# ejabberdctl restore /tmp/jabber-backup
Can't restore backup from "/tmp/jabber-backup" at node ejabberd@jabber: Table disco_publish does not exist.
root@jabber:/tmp# ejabberdctl debug
Attaching Erlang shell to node ejabberd@jabber.
To detach it, press: Ctrl+G, q, Return

Erlang R13B03 (erts-5.7.4) [source] [64-bit] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.4  (abort with ^G)
(ejabberd@jabber)1> mnesia:restore("/tmp/jabber-backup", [{skip_tables, [disco_publish]}]).
{aborted,{no_exists,user_caps}}
(ejabberd@jabber)2>

thoughts?

You installed ejabberd 2.1.5,

You installed ejabberd 2.1.5, started it, it created the tables with empty content. Then you tried to import a 2.0.1 backup file. Mnesia complains that the tables disco_publish, user_caps, and maybe others don't exist.

Does Mnesia mean that they don't exist in the new DB, or in the old backup file?

Looking at the source code history, those tables are not used since ejabberd 2.1.3. So, they don't exist in the new DB.

Add user_caps also to that skip_tables option, and try again to restore the backup.

I assume that means

I assume that means user_caps_resources is also no longer needed? If so, it looks like it worked:

root@jabber:/tmp# ejabberdctl debug
Attaching Erlang shell to node ejabberd@jabber.
To detach it, press: Ctrl+G, q, Return

Erlang R13B03 (erts-5.7.4) [source] [64-bit] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.4  (abort with ^G)
(ejabberd@jabber)1> mnesia:restore("/tmp/jabber-backup", [{skip_tables, [disco_publish,user_caps]}]).
{aborted,{no_exists,user_caps_resources}}
(ejabberd@jabber)2> mnesia:restore("/tmp/jabber-backup", [{skip_tables, [disco_publish,user_caps,user_caps_resources]}]).
{atomic,[config,privacy,local_config,passwd,roster,
         last_activity,sr_user,offline_msg,route,motd,acl,s2s,vcard,
         caps_features,sr_group,mod_register_ip,vcard_search,
         motd_users,session,private_storage,iq_response]}
(ejabberd@jabber)3>

Thanks so much!

Syndicate content