Please help; running backup failes; userdb lost?

Hello, I am running ejabberd 1.1.2-6 without any plugins.
Since I reinstalled my server I made a ejabberd baclup file ejabberd.dump.
Now, I want to insert this file via ejabberdctl restore, but nothing seems to happen.
No error message, but The Server ist empty after that; no users.

My ejabberd.dump file begins with:
{tables,[{local_config,[{record_name,local_config},{attributes,[key,value]}]},
{config,[{record_name,config},{attributes,[key,value]}]},
{privacy,[{record_name,privacy},{attributes,[us,default,lists]}]},
{passwd,[{record_name,passwd},{attributes,[us,password]}]},
{irc_custom,[{record_name,irc_custom},{attributes,[us_host,data]}]},
{roster,[{record_name,roster},

Thanks a lot, Im in big trouble!
Thomas

If you 'dump', then you later need to 'load'

In ejabberd there are three ways to make a backup of the Mnesia database, and depending in the method you use to backup, you need to use the proper way to restore database. It is a good idea to backup the database in the three ways, so you later have oportunity to use any of them:

  • ejabberdctl dump file & load file: the file is plain text, so you can also edit it if you want.
  • ejabberdctl backup file & restore file: the file is binary, so the content is not easy to read. This method is preferable for large databases.
  • Copy the directory /var/lib/ejabberd/db (or similar) that has all the files acl.DCD, acl.DAT, ... Then you can put the files when ejabberd is reinstalled.

You have a text dump, so you used 'ejabberdctl dump'. Now you must use 'ejabberdctl'

In this example with ejabberd 2.0.2 the server has three accounts. I 'dump' database to text file, delete two accounts, verify the deletion, then I load the text database and verify that I have all three accounts again:

$ ejabberdctl registered-users localhost
badlop
testaccount
testaccount2
$ ejabberdctl dump /etc/ejabberd1.text
Can't store dump in "/etc/ejabberd1.text" at node ejabberd@localhost: eacces
$ ejabberdctl dump /tmp/ejabberd1.text
$ ejabberdctl unregister testaccount localhost
$ ejabberdctl unregister testaccount2 localhost
$ ejabberdctl registered-users localhost
badlop
$ ejabberdctl load /tmp/ejabberd1.text
** Table local_config already exists on ejabberd@localhost, just entering data
** Table config already exists on ejabberd@localhost, just entering data
** Table privacy already exists on ejabberd@localhost, just entering data
** Table passwd already exists on ejabberd@localhost, just entering data
** Table irc_custom already exists on ejabberd@localhost, just entering data
** Table roster already exists on ejabberd@localhost, just entering data
** Table last_activity already exists on ejabberd@localhost, just entering data
** Table sr_user already exists on ejabberd@localhost, just entering data
** Table offline_msg already exists on ejabberd@localhost, just entering data
** Table motd already exists on ejabberd@localhost, just entering data
** Table acl already exists on ejabberd@localhost, just entering data
** Table disco_publish already exists on ejabberd@localhost, just entering data
** Table vcard already exists on ejabberd@localhost, just entering data
** Table sr_group already exists on ejabberd@localhost, just entering data
** Table vcard_search already exists on ejabberd@localhost, just entering data
** Table motd_users already exists on ejabberd@localhost, just entering data
** Table private_storage already exists on ejabberd@localhost, just entering data
** Table pubsub_item already exists on ejabberd@localhost, just entering data
** Table muc_room already exists on ejabberd@localhost, just entering data
** Table pubsub_state already exists on ejabberd@localhost, just entering data
** Table muc_registered already exists on ejabberd@localhost, just entering data
** Table pubsub_node already exists on ejabberd@localhost, just entering data
$ ejabberdctl registered-users localhost
badlop
testaccount
testaccount2

In this example I backup to binary file and restore:

$ ejabberdctl registered-users localhost
badlop
testaccount
testaccount2
$ ejabberdctl backup /tmp/eja1.backup
$ ejabberdctl unregister testaccount localhost
$ ejabberdctl unregister testaccount2 localhost
$ ejabberdctl registered-users localhost
badlop
$ ejabberdctl restore /tmp/eja1.backup
$ ejabberdctl registered-users localhost
badlop
testaccount
testaccount2
Syndicate content