ejabberd - Comments for "&amp;#039;ejabberdctl dump&amp;#039; dumps just 7 accounts out of 103" https://www.ejabberd.im/node/4077 en I am getting the same error. https://www.ejabberd.im/node/4077#comment-59087 <p>I am getting the same error. Please, can you post how did you solve it?</p> Thu, 20 Sep 2012 10:50:21 +0000 cloudos comment 59087 at https://www.ejabberd.im found a DB location https://www.ejabberd.im/node/4077#comment-56050 <p>Mea culpa!<br /> Finally I learned that my DB is in MySQL not in Mnesia (sorry for my a-Mnesia :) )<br /> It is strange that the connection from web interface and clients were to MySQL, but all management utilities were connecting to Mnesia.<br /> May be it's because the configuration was not make properly:<br /> {host_config, "chat.coke.com", [{auth_method, [odbc]}]}.<br /> {odbc_server, {mysql, "localhost", "jabber", "jabber", "pass"}}.</p> <p>Anyway, I've got another problem with migration to a new server.<br /> That's what I did:<br /> 1) Dumped MySQL and moved it to the new server.<br /> 2) Tried a connection:</p> <pre> # mysql -h localhost -u jabber -ppass jabber mysql&gt; show tables; mysql&gt; select * from users; </pre><p>all accounts are there</p> <p>3) Stopped end copied ejabberd dir (it was installed from binary, so everything is in one dir /opt/ejabberd-2.0.2_2)<br /> 4) started deamon and got an error:</p> <pre> E(&lt;0.273.0&gt;:ejabberd_odbc:314) : MySQL connection failed: connect_failed </pre><p> 5) installed ejabberd 2.1.3 from binary install wizard, configured MySQL connection:</p> <pre> {auth_method, odbc}. {odbc_server, {mysql, "localhost", "jabber", "jabber", "pass"}}. </pre><p> 6) started a daemon and got an error:</p> <pre> E(&lt;0.3226.0&gt;:ejabberd_odbc:514) : mysql_conn: Failed connecting to "localhost":3306 : {error, "connect failed : {error, econnrefused}"} </pre><p> So, it seems like there is a connection to MySQL error, but test connection from command line passed.<br /> What can you suggest?</p> Tue, 15 Jun 2010 10:25:20 +0000 24pm comment 56050 at https://www.ejabberd.im Only one program opens the database: the running ejabberd https://www.ejabberd.im/node/4077#comment-55844 <p>When "ejabberdctl export2odbc" is called, it connects to the running ejabberd and tells it to export its database.</p> <p>You can see in ejabberd WebAdmin -&gt; Nodes -&gt; your node -&gt; database, if the passwd Mnesia table of that running server has 7 or 103 users. When you call export2odbc or the other commands, they should produce a dump with exactly that number of accounts.</p> <p>Some reasons I can think to get a dump with inaccurate information (as you get):</p> <ul> <li>You have two different ejabberd servers running, each with a different database. Your ejabberdctl connects to the wrong one </li><li>Some elements in the database can't be exported correctly, and only some of them are exported </li><li>One element in the database can't be exported, and the export stops when the exportion attempt of that element crashes </li></ul> Thu, 03 Jun 2010 08:17:00 +0000 mfoss comment 55844 at https://www.ejabberd.im May be wrong Mnesia DB files? https://www.ejabberd.im/node/4077#comment-55842 <p>1) Mnesia database spool files (*.DCD, *.DCL, *.DAT) </p> <p>I found them in <em>/opt/ejabberd-2.0.2_2/database/ejabberd@localhost</em> and moved it to a new server - the same result: 7 users out of 103. I checked it in browser in old and new servers: old one shows all 103 users, a new one only 7 but all rosters filled by absent accounts. The command <strong>ejabberctl dump</strong> on new server gives just 7 accounts.</p> <p>2) I tried to export data from Mnesia: installed <strong>mod_ctlextra</strong> and exported data with <strong>ejabberdctl export2odbc</strong> - <em>passwd.txt</em> shows just 7 users.</p> <p>It seems like ejabberd has two databases in my case: one for work and one for DB managment.<br /> I have only one ejabberd installed and running:</p> <div class="codeblock"><code># ps ax | grep jabber<br />28884 ?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; S&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0:00 /opt/ejabberd-2.0.2_2/bin/epmd -daemon<br />29543 pts/4&nbsp;&nbsp;&nbsp; Sl&nbsp;&nbsp;&nbsp;&nbsp; 0:04 /opt/ejabberd-2.0.2_2/bin/beam.smp -K true -P 250000</code></div> <p>Exploring database spool files I found that file <strong>passwd.DCD</strong> did not change from installation date (at list file's datetime) and has just those 7 accounts! But file <strong>sr_user.DCD</strong> has recent datetime and holds all users (or so it seems).</p> <p>Well, as I understand <em>ejabberdctl</em> works with <strong>passwd.DCD</strong> which is not up-to-date and <em>epmd</em> or <em>beam.smp</em> (or whatever serve as a jabber server) keep their data in another place. So:</p> <p>How to make <em>ejabberdctl</em> take accounts from the right place, if <strong>passwd.DCD</strong> is wrong?<br /> Or how to place all accounts into the right place, if <strong>passwd.DCD</strong> is the one?</p> Wed, 02 Jun 2010 04:15:59 +0000 24pm comment 55842 at https://www.ejabberd.im Check ejabberdctl. Check the Guide https://www.ejabberd.im/node/4077#comment-55838 <div class="quote-msg"> <div class="quote-author"><em>24pm</em> wrote:</div> <p>Mnesia spool dir is not in "usual path", how can I find out where it is?<br /> Does any configuration file mentions it?</p></div> <p>Probably you can see the path with:</p> <pre> $ ejabberdctl ... --spool dir Database spool dir: //var/lib/ejabberd </pre><div class="quote-msg"> <div class="quote-author"><em>24pm</em> wrote:</div> <p>What files should be there? </p></div> <p>Search in the ejabberd Guide for the words "spool directory".</p> Tue, 01 Jun 2010 09:06:44 +0000 mfoss comment 55838 at https://www.ejabberd.im Mnesia spool dir https://www.ejabberd.im/node/4077#comment-55835 <p>First two ways are broken. Mnesia spool dir is not in "usual path", how can I find out where it is?<br /> What files should be there? Does any configuration file mentions it?</p> Tue, 01 Jun 2010 02:48:41 +0000 24pm comment 55835 at https://www.ejabberd.im It's a strange problem. You https://www.ejabberd.im/node/4077#comment-55825 <p>It's a strange problem.</p> <p>You have three ways to get your database:</p> <ul> <li>dump, and then load </li><li>backup, and then install_fallback, or restore </li><li>Copy the Mnesia spool dir (usually somewhere in /var/lib/ejabberd) to the new location </li></ul> Fri, 28 May 2010 09:18:25 +0000 mfoss comment 55825 at https://www.ejabberd.im