Stuck during domain change

Hi!
Today I tried to change the hostname for my long-time running ejabberd server.

I'm really stuck now because it seems that ejabberd cannot start, no matter what combination of hostname I set up on the server and in ejabberd.cfg

I've tried changing all my options, and the hostname back to what it was originally, but it seems that somehow I always get this kind of error in the log file:

=ERROR REPORT==== 2015-02-27 16:16:15 ===
E(<0.38.0>:ejabberd_config:554) : 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:
   /var/lib/ejabberd
Maybe the problem is a change in the computer hostname,
or a change in the Erlang node name, which is currently:
   wrong@domainhere
Check the ejabberd guide for details about changing the
computer hostname or Erlang node name.

=INFO REPORT==== 2015-02-27 16:16:15 ===
    application: ejabberd
    exited: {bad_return,{{ejabberd_app,start,[normal,[]]},
                         {'EXIT',"Error reading Mnesia database"}}}
    type: temporary

For some configurations, ejabberdctl even crashes before anything is written to the log file.

I can be more specific, but it seems I need a tiny bit of hand holding here.

Thanks for any help you can provide!

-Fredrik

Mnesia database schema can

Mnesia database schema can work in cluster. For that reason, a database schema is tight to a precise nodename.

If you need to change the Erlang VM nodename (that typically includes your server hostname), then you need to export Mnesia database from one hostname and import it in the new hostname.

I hope this helps,

I have changed the hostname

I have changed the hostname back, all of the places where I know I can change it. But ejabberd seems to still use the new node name.

How do I export in this case?

I even tried to delete

I even tried to delete everything in /var/lib/ejabberd, and ejabberdctl seems to report about the new hostname.... where is it stored.

I thought I had erased every trace of the new hostname, but ejabberd doesn't ever forget about it.

Correction: when I deleted

Correction: when I deleted the files in /var/lib/ejabberd, ejabberd started again properly... but I lost all my data of course... Is there a way to fix my backed up data manually, so ejabberd can start?

I actually got it to run

I actually got it to run again...

My hint was that by new hostname wasn't written down any other place than /etc/hosts.

So I changed the order of the entries written behind '127.0.1.1', so that the first entry was unchanged from before.... and voila... no more crashes.

But seriously... that is unexpected behaviour... I nearly decided to restart and have all my users create new passwords and everything...

Hello, Thanks for your

Hello,

Thanks for your feedback.
Yes, this is unexpected, but that related to ability to work as a cluster with multiple nodes.

We plan to write a process for changing server hostname on our new documentation site.

Thanks for the feedback :)

Thank you for being here, and

Thank you for being here, and caring.
It actually means a lot.

I actually understand better now why it happened, at least.

Hello Fredrik, Actually, I

Hello Fredrik,

Actually, I have been told, the documentation for hostname change is already written and published here:

https://docs.ejabberd.im/admin/guide/#change-computer-hostname

I hope this helps,

Syndicate content