User Tools

Site Tools


linux:debian:start

This is an old revision of the document!


Debian

Despite I don't favor Debian distribution too much for this and that, this page is not meant as rant. It is actually quick reference for me. If you find it useful, good. If not, just move on.

If you got offended by the content, I'm sorry.

Quick Tips and Tricks

Dependency hell

NOTE: I have no idea how apt works. # apt-cache show <package> ; didn't show MySQL as recommended package nor as suggested one. Yes, I will have to read up on apt … some day.

Just to give an example. Installation of postfix surprised me with installation of libmysql, mysql-client and what not.

If you don't want to give in so easy, because I don't need nor plan to utilize MySQL at this host right now, you can try:

root@foo:~# apt-get install --no-install-recommends <packages_to_install>

This way I ended up with what I wanted and needed - postfix and ssl-cert as an extra, which made a bit of sense. However, I didn't get away with it in case of dovecot.

Migrating ejabberd 2.0.x to 2.1.x

WARNING - still work in progress!!!

Debian 6.0 Squeeze, however I think this doesn't depend on your GNU/Linux distribution.

  • Migrating from: ejabberd-2.0.5-x86_84
  • Migrating to: ejabberd-2.1.5-3+squeeze1

I recommend to backup /var/lib/ejabberd prior to any changes. If anything goes wrong or doesn't work, you can start very quickly from scratch.

root@foo:~# # backup
root@foo:~# cp -apr /var/lib/ejabberd /tmp

root@foo:~# #restore, which is just way around
root@foo:~# cp -apr /tmp/ejabberd /var/lib/

Version 1:

  • dump database at old ejabberd
root@foo:~# ejabberdctl backup /tmp/ejabberd.backup
  • move backup, configs etc. to new machine, if needed, using eg. SCP
  • change hostname, if needed or got changed, as described in Migrate FAQ
  • restore database as shown bellow. Skipping tables can be iterative process:
root@foo:~# sh /etc/init.d/ejabberd stop
root@foo:~# ejabberd debug
[...]
(ejabberd@foo)1> mnesia:restore("/tmp/ejabberd2.backup",[{skip_tables,[disco_publish]}]).
{aborted,{no_exists,user_caps}}
(ejabberd@foo)2> mnesia:restore("/tmp/ejabberd2.backup",[{skip_tables,[disco_publish,user_caps]}]). 
{aborted,{no_exists,user_caps_resources}}
(ejabberd@foo)3> mnesia:restore("/tmp/ejabberd2.backup",[{skip_tables,[disco_publish,user_caps,user_caps_resources]}]).
{atomic,[config,privacy,local_config,passwd,irc_custom,
         roster,last_activity,sr_user,offline_msg,route,motd,acl,s2s,
         vcard,caps_features,sr_group,mod_register_ip,vcard_search,
         motd_users,session,private_storage,pubsub_item,muc_room,
         pubsub_state,iq_response,muc_registered,muc_online_room|...]}
(ejabberd@foo)4>q().
  • start ejabberd
root@foo:~# sh /etc/init.d/ejabberd start
  • now, I would like to say “enjoy”, but there was no joy. I couldn't get authenticated no matter what. Perhaps password encryption got changed, I don't know.

Version 2:

  • dump database at old server
root@foo:~# ejabberctl dump /tmp/ejabberd.dump
  • move backup, configs etc. to new machine, if needed, using eg. SCP
  • start ejabberd at new server
  • restore database
    • you may try to restore database right away by following command. However, it didn't work for me, not even after removing disco stuff.
    • OR FIXME write a parser to get rid of problematic things in .dump
      • problematic stuff is:
        • everything related to disco
        • user_caps - since it has a lot of entries, I didn't want to remove it by hand. Thus I've removed just 'mod_caps'
        • pubsub_node - I had to remove data related to this table, because something got changed and no, I'm not going to study Erlang right now
root@foo:~# ejabberdctl load /tmp/ejabberd.dump
  • hopefully enjoy!
linux/debian/start.1320347799.txt.gz · Last modified: 2011/11/03 14:16 by stybla