ejabberd - Comments for "Please help; running backup failes; userdb lost?" https://www.ejabberd.im/node/3270 en If you 'dump', then you later need to 'load' https://www.ejabberd.im/node/3270#comment-53728 <p>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:</p> <ul> <li>ejabberdctl dump file &amp; load file: the file is plain text, so you can also edit it if you want. </li><li>ejabberdctl backup file &amp; restore file: the file is binary, so the content is not easy to read. This method is preferable for large databases. </li><li>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. </li></ul> <p>You have a text dump, so you used 'ejabberdctl dump'. Now you must use 'ejabberdctl'</p> <p>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:</p> <pre> $ 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 </pre><p> In this example I backup to binary file and restore:</p> <pre> $ 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 </pre> Mon, 10 Nov 2008 09:30:07 +0000 mfoss comment 53728 at https://www.ejabberd.im