Help with upgrading ejabberd and changing the domain name.

Hi,
Our current ejabberd installation:

- CentOS release 5.8 (Final)
- ejabberd v2.1.4
- local in house server
- user authentication happens using LDAP and the LDAP server runs on the same machine.
- configuration shows internal database is getting used.

This current machine is at a point where its getting very hard to manage. It keeps giving disk error messages. So, we have decided to move our messaging server (ejabberd) to AWS.

This assignment is given to me, so I started playing around with it. Current machine in AWS:

- CentOS release 6.5 (Final)
- ejabberd 15.04
- user authentication using LDAP and the ldap server runs on the same machine.

One of the requirements was to move from old domain name to new domain name. So, lets say, I wanted to move from im.example1.com to im.example2.com

My first question is about the 2nd part. Can we change the domain name? I googled and got to the link
- https://www.process-one.net/docs/ejabberd/guide_en.html#htoc82

Is it what is suppose to be done? ( I don't know much about ejabberd server but I am not sure about that )

To install, i downloaded the run file ( ejabberd-15.04-linux-x86_64-installer.run ) and followed the on screen configuration. Used domain im.example1.com and finished the installation. As I wanted to just start with the test so I first tried starting with the same domain name ( im.example1.com ). copied the roster.DCD file from old machine to /opt/ejabberd-15.04/database/ejabberd@localhost/roster.DCD in new machine.

When I started using "/opt/ejabberd-15.04/bin/ejabberdctl start" command, it gave me a lot of error messages in the log files. The error looks like this.

from crash.log

2015-06-03 16:34:27 =ERROR REPORT====
Mnesia(ejabberd@localhost): ** WARNING ** Mnesia is overloaded: {dump_log,write_threshold}

from error.log

2015-06-03 16:34:27.079 [error] <0.146.0> Mnesia(ejabberd@localhost): ** WARNING ** Mnesia is overloaded: {dump_log,write_threshold}

from ejabberd.log

2015-06-03 16:34:25.278 [info] <0.7.0> Application inets started on node ejabberd@localhost
2015-06-03 16:34:25.309 [info] <0.38.0>@ejabberd_config:convert_table_to_binary:971 Converting 'roster' table from strings to binaries.
2015-06-03 16:34:27.079 [error] <0.146.0> Mnesia(ejabberd@localhost): ** WARNING ** Mnesia is overloaded: {dump_log,write_threshold}

My next question is, are these messages ok?

I am able to connect to the new ejabberd with my old user name and password ( obviously, as they are getting fetched from ldap server and i took ldap dump and restored it on the new machine ). I can see my contact list as they were.

Can you guys give me some pointers on how to go about this entire upgrade / migration?

Thanks in advance and apologies for making the question this big as I was trying to provide as much information as possible.

abhinav784 wrote: One of the

abhinav784 wrote:

One of the requirements was to move from old domain name to new domain name. So, lets say, I wanted to move from im.example1.com to im.example2.com

My first question is about the 2nd part. Can we change the domain name? I googled and got to the link
- https://www.process-one.net/docs/ejabberd/guide_en.html#htoc82

Is it what is suppose to be done? ( I don't know much about ejabberd server but I am not sure about that )

No, they are different things:
- You want to change the Jabber/XMPP domain
- The guide section you mentioned is about Erlang computer hostname, and it is only necessary in some cases, if Mnesia cannot read your old database. Apparently you don't have problems reading your old Mnesia database, so don't worry about that.

abhinav784 wrote:

When I started using "/opt/ejabberd-15.04/bin/ejabberdctl start" command, it gave me a lot of error messages in the log files. The error looks like this.

from crash.log
2015-06-03 16:34:27 =ERROR REPORT====
Mnesia(ejabberd@localhost): ** WARNING ** Mnesia is overloaded: {dump_log,write_threshold}

from error.log
2015-06-03 16:34:27.079 [error] <0.146.0> Mnesia(ejabberd@localhost): ** WARNING ** Mnesia is overloaded: {dump_log,write_threshold}

from ejabberd.log
2015-06-03 16:34:25.278 [info] <0.7.0> Application inets started on node ejabberd@localhost
2015-06-03 16:34:25.309 [info] <0.38.0>@ejabberd_config:convert_table_to_binary:971 Converting 'roster' table from strings to binaries.
2015-06-03 16:34:27.079 [error] <0.146.0> Mnesia(ejabberd@localhost): ** WARNING ** Mnesia is overloaded: {dump_log,write_threshold}

My next question is, are these messages ok?

Those are only warnings saying that it writes stuff slow on disk, which is normal because ejabberd is doing heavy operations. You should worry only if ejabberd did this all the time during normal daily use. So, don't worry now.

abhinav784 wrote:

I am able to connect to the new ejabberd with my old user name and password ( obviously, as they are getting fetched from ldap server and i took ldap dump and restored it on the new machine ). I can see my contact list as they were.

Can you guys give me some pointers on how to go about this entire upgrade / migration?

Apparently you are on the good path. The only remaining change is to change XMPP domain from im.example1.com to im.example2.com

You can change ejabberd configuration easily in ejabberd.yml, then restart ejabberd. Probably, this isn't enough because some information in the Mnesia database still use the old domain. For example, rosters, offline messages, private table...

If you used MySQL, then you would know what to do: run some queries to update some fields in some tables.

As you use Mnesia, I'll tell you a easy (but time consuming) process:
1. Dump the mnesia database to text file. Use WebAdmin or "ejabberdctl dump /tmp/domain1.txt"
2. Edit that text file, and replace old domain with new domain
3. Stop ejabberd
4. Move away the old Mnesia database files
5. Start ejabberd, it will create empty mnesia database
6. Load your modified mnesia text file with "ejabberdctl load /tmp/domain2.txt

That worked like a charm. (

That worked like a charm. ( although could not figure out where the ejabberdctl utility was. the one at /opt/ejabberd-2.1.4/bin/ejabberdctl kept complaining about dump being not an option. thankfully web admin access was there. )

While restoring, it gave a total of 5 error messages.

Error in line:246753 of:"ejabberd-domainname.dump" syntax error before: '.'
Can't load dump in "/opt/ejabberd-15.04/database/ejabberd@localhost/ejabberd-domainname.dump" at node ejabberd@localhost: read

Error in line:246919 of:"ejabberd-domainname.dump" syntax error before: '}'
Can't load dump in "/opt/ejabberd-15.04/database/ejabberd@localhost/ejabberd-domainname.dump" at node ejabberd@localhost: read

Error in line:630800 of:"ejabberd-domainname.dump" syntax error before: stores
Can't load dump in "/opt/ejabberd-15.04/database/ejabberd@localhost/ejabberd-domainname.dump" at node ejabberd@localhost: read

Error in line:704139 of:"ejabberd-domainname.dump" syntax error before: '}'
Can't load dump in "/opt/ejabberd-15.04/database/ejabberd@localhost/ejabberd-domainname.dump" at node ejabberd@localhost: read

Problem 'error {case_clause,
{aborted,
{bad_type,
{roster,
{"user-name1","im.domainname.com",
{"user-name2","im.domainname.com",[]}},
{"user-name1","im.domainname",
{"user-name3","im.domainname.com",[]}},
{"user-name4","im.domainname.com"},
{"user-name5","im.domainname.com",[]},
"User Name",both,none,
["Group Name 1"],
[],[]}}}}' occurred executing the command.
Stacktrace: [{ejabberd_admin,load_mnesia,1,
[{file,"src/ejabberd_admin.erl"},{line,566}]},
{ejabberd_commands,execute_command2,2,
[{file,"src/ejabberd_commands.erl"},
{line,320}]},
{ejabberd_ctl,call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,293}]},
{ejabberd_ctl,try_call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,269}]},
{ejabberd_ctl,process2,3,
[{file,"src/ejabberd_ctl.erl"},{line,218}]},
{ejabberd_ctl,process,1,
[{file,"src/ejabberd_ctl.erl"},{line,203}]},
{rpc,'-handle_call_call/6-fun-0-',5,
[{file,"rpc.erl"},{line,205}]}]

Problem 'error {case_clause,
{aborted,
{bad_type,
{roster,
{"user-name7","im.domainnamedomainname.com",[]},
"User Name 8",none,none,
["Group Name 2"],
[{"xmlns","jabber:iq:roster"}],
[]}}}}' occurred executing the command.
Stacktrace: [{ejabberd_admin,load_mnesia,1,
[{file,"src/ejabberd_admin.erl"},{line,566}]},
{ejabberd_commands,execute_command2,2,
[{file,"src/ejabberd_commands.erl"},
{line,320}]},
{ejabberd_ctl,call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,293}]},
{ejabberd_ctl,try_call_command,3,
[{file,"src/ejabberd_ctl.erl"},{line,269}]},
{ejabberd_ctl,process2,3,
[{file,"src/ejabberd_ctl.erl"},{line,218}]},
{ejabberd_ctl,process,1,
[{file,"src/ejabberd_ctl.erl"},{line,203}]},
{rpc,'-handle_call_call/6-fun-0-',5,
[{file,"rpc.erl"},{line,205}]}]

All of them came one by one, one block after the other. I am not sure why those file format error messages came in. But I can happily live with that. I simply removed the respective line which had this formatting problem. And all good. Restarted the service and all good..

The only problem now that see is I am not able to transfer file. I have enabled mod_proxy65 module( mod_proxy65: [] , the online document said default value is just fine so i went with default value only), but it doesn't seem to work. I will continue with my troubleshooting.

Thanks a ton badlop

Syndicate content