"Upgrade" from 1.1.1 on one machine to 2.0.2 on a different machine

Hi,

I'm "upgrading" from 1.1.1 on one machine to 2.0.2 on a different machine (both are Windows machines). Not really an upgrade, but a clean install on a new machine, and I'd like to pull over all the accounts from the old machine.

First, I deleted all the files (*.DCD, *.DCL, etc.) in the /database/ejabberd@localhost dir on the 2.0.2 install and copied over all these files from the /spool dir on the 1.1.1 install. And I manually updated ejabberd.cfg on the 2.0.2 install to bring over the admin perms. I don't believe there was much else to change there; obviously the "hosts" name is different.

However, I can't get to the web interface now (401 Unauthorized) w/any of the admin accounts. Before I copied everything over I *was* able to log onto the 2.0.2 web interface via the admin account set-up during install. But now none of the admin accounts get me into the web interface.

I'm sure working between two different machines with a different host name complicates the issue.

Thanks for reading.
JB

Database not read, or admin privileges not granted

The problem can be that either

  • The database is not read correctly, so you don't have any accounts. You can verify that easily: can Jabber clients login to the accounts, or do they need to create the accounts?
  • If the database was read correctly, and the users that were admins can login using Jabber, then the problem may be that those accounts do not have 'admin' privilege. To grant admin privilege to a Jabber account you need to specify in ejabberd.cfg. Check the ejabberd Guide.

In all cases you should look at ejabberd.log and sasl.log because maybe there is some error message that points to the problem.

Crash...

Thanks for the reply.

sas.log is showing a crash report upon reading the Mnesia database.

Is 1.1.1 and 2.0.2 possibly too different in this regard? I'm pulling the DCL/DCD/DAT/etc. files over from a working 1.1.1 install. I also tried stopping the 1.1.1 service and then moving the database files, but I got the same result.

=CRASH REPORT==== 10-Nov-2008::11:17:41 ===
crasher:
pid: <0.35.0>
registered_name: []
exception exit: {bad_return,{{ejabberd_app,start,[normal,[]]},
{'EXIT',"Error reading Mnesia database"}}}
in function application_master:init/4
initial call: application_master:init(<0.5.0>,<0.34.0>,
{appl_data,ejabberd,
[ejabberd,ejabberd_sup,
ejabberd_auth,ejabberd_router,
ejabberd_sm,ejabberd_s2s,
ejabberd_local,ejabberd_listeners,
ejabberd_iq_sup,
ejabberd_service_sup,
ejabberd_s2s_out_sup,
ejabberd_s2s_in_sup,
ejabberd_c2s_sup,
ejabberd_mod_roster,
ejabberd_mod_echo,
ejabberd_mod_pubsub,
ejabberd_mod_irc,ejabberd_mod_muc,
ejabberd_offline,random_generator],
undefined,
{ejabberd_app,[]},
[acl,adhoc,configure,
cyrsasl_anonymous,cyrsasl,
cyrsasl_digest,cyrsasl_plain,
ejabberd_admin,ejabberd_app,
ejabberd_auth_anonymous,
ejabberd_auth,
ejabberd_auth_external,
ejabberd_auth_internal,
ejabberd_auth_ldap,
ejabberd_auth_odbc,
ejabberd_auth_pam,ejabberd,
ejabberd_c2s,ejabberd_c2s_config,
ejabberd_config,ejabberd_ctl,
ejabberd_frontend_socket,
ejabberd_hooks,ejabberd_http,
ejabberd_http_bind,
ejabberd_http_poll,
ejabberd_listener,ejabberd_local,
ejabberd_logger_h,
ejabberd_loglevel,
ejabberd_node_groups,
ejabberd_rdbms,ejabberd_receiver,
ejabberd_router,ejabberd_s2s,
ejabberd_s2s_in,ejabberd_s2s_out,
ejabberd_service,ejabberd_sm,
ejabberd_socket,ejabberd_sup,
ejabberd_system_monitor,
ejabberd_tmp_sup,ejabberd_update,
ejabberd_web_admin,ejabberd_web,
ejabberd_zlib,ejd2odbc,eldap,
eldap_filter,eldap_pool,
eldap_utils,'ELDAPv3',extauth,
gen_iq_handler,gen_mod,
gen_pubsub_node,
gen_pubsub_nodetree,iconv,idna,
jd2ejd,jlib,mod_adhoc,
mod_announce,mod_caps,
mod_configure2,mod_configure,
mod_disco,mod_echo,mod_http_bind,
mod_http_fileserver,mod_irc,
mod_irc_connection,mod_last,
mod_last_odbc,mod_muc,mod_muc_log,
mod_muc_room,mod_offline,
mod_offline_odbc,mod_privacy,
mod_privacy_odbc,mod_private,
mod_private_odbc,mod_proxy65,
mod_proxy65_lib,
mod_proxy65_service,
mod_proxy65_sm,mod_proxy65_stream,
mod_pubsub,mod_register,
mod_roster,mod_roster_odbc,
mod_service_log,mod_shared_roster,
mod_stats,mod_time,mod_vcard,
mod_vcard_ldap,mod_vcard_odbc,
mod_version,node_buddy,node_club,
node_default,node_dispatch,
node_pep,node_private,node_public,
nodetree_default,nodetree_virtual,
p1_fsm,p1_mnesia,
ram_file_io_server,randoms,sha,
shaper,stringprep,stringprep_sup,
tls,translate,xml,xml_stream,
'XmppAddr'],
[],infinity,infinity},
normal)
ancestors: [<0.34.0>]
messages: [{'EXIT',<0.36.0>,normal}]
links: [<0.34.0>,<0.5.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 987
stack_size: 23
reductions: 160
neighbours:

Updated host name in Mnesia files

I manually went through all the DCL/DCD/DAT/etc. files and updated the host name to the new machine's name.

I don't see the "Error reading Mnesia database" now. However, I'm still getting a "bad_return".

=CRASH REPORT==== 12-Nov-2008::08:57:25 ===
crasher:
pid: <0.35.0>
registered_name: []
exception exit: {bad_return,
{{ejabberd_app,start,[normal,[]]},
{'EXIT',
{aborted,
{node_not_running,ejabberd@localhost}}}}}
in function application_master:init/4
initial call: application_master:init(<0.5.0>,<0.34.0>,
...

Narrow down issue

So I figured I would try to narrow down where the issue is.

I tried upgrading from 1.1.1 to 2.0.2 on the *same* machine. Didn't work; "Error reading Mnesia database".
Then I tried upgrading to just 1.1.4, then 1.1.3 and then 1.1.2. No go on all three. FYI. I did uninstall the Erlang package that 1.1.1 relied on (which I believe is no longer needed from 1.1.2 on).

sasl.log (1.1.2):
error_info: {bad_return,{{ejabberd_app,start,[normal,[]]},
{'EXIT',{{badmatch,{aborted,{no_exists,config}}},
[{ejabberd_config,set_opts,1},
{ejabberd_app,start,2},
{application_master,start_it_old,4}]}}}}

So I can't even upgrade from 1.1.1 to 1.1.2 on the same machine. I'll do some searching around.

Thanks,
JB

"solution"

Here was the "solution" to my particular problem.

Since I couldn't get any kind of upgrade scenario to work, and we don't really need any of the new features of ejabberd (1.1.1 has been rock solid for two years), I just installed 1.1.1 on the new machine (along with version R10B-10 of Erlang/OTP).

Then with the new jabber server not running, I copied over all the files from the old machine's spool directory to the new machines spool directory. Next, I went in with a hex editor to each file and changed every reference to the old machine name to the new machine name.

That did the trick. We're back up and running.

Thanks, badlop, for pointing me to the log files.
JB

Other solution to try: edit node name in ejabberdctl.cfg

jb wrote:

I copied over all the files from the old machine's spool directory to the new machines spool directory. Next, I went in with a hex editor to each file and changed every reference to the old machine name to the new machine name.

I arrived a little late, but anyway: in the config dir of 2.0.2 and newer, the file ejabberdctl.cfg allows you to define the erlang node name: "ERLANG_NODE=ejabberd@localhost". The next time that Mnesia doesn't start because the node name doesn't match, you can try setting there the old node name (you can see it in log files).

In future ejabberd releases, when Mnesia doesn't start maybe it's clever enough to show a meaningful error message to the administrator.

Syndicate content