Hi All,
I’m looking for some advice please. What would be the easiest way to automate the mnesia restore process when the nodename changes?
I have an ejabberd mnesia database backup file where the nodename was set to ‘ejabberd@localhost’. I want to restore this backup to a new machine where the hostname will be something like ‘ejabberd@host1’. The idea is to add a second clustered host later on.
The restore process must be automated, but I need to figure out what the old nodename was and what the new nodename will be so that I can use the built-in ejabberdctl command mnesia_change_nodename oldnodename newnodename oldbackup newbackup
before calling install_fallback file
.
See the attached escript for my attempted solution where I tried to restore a temp copy of the backup in order to parse the old node name. mnesia:restore
or mnesia:install_fallback
seems to require the nodenames to match exactly before it will extract the database backup file
Hopefully there’s an easier solution? Thanks.