munin: migration from a 32bit to a 64bit host


When you migration your munin from a 32bits to a 64bits installation, you have to dump restore all your rrd files. Saying that looks like a pain, but in fact, it is easy to do ;-) . We migrate some months ago our munin/nagios server at work from an old 32bits server to a brand new rack server using a 64bit Ubuntu 8.04.1, we performed the following scripts and kept our historic.

Here are the two scripts (you need some disk space to perform the dump / restore) . I assume you have copied the content of you “old” server on the new server. On Ubuntu/Debian servers, rrd files usually lives in /var/lib/munin.

First dump script :

#!/bin/bash
for f in `find /var/lib/munin -name '*.rrd' -print` ; do
    xml_file=`dirname $f`/`basename $f .rrd`.xml
   rrdtool dump "$f" > "${xml_file}"
   chown root:root "${xml_file}"
done

Import script :

#!/bin/bash
for f in `find /var/lib/munin -name '*.xml' -print` ; do
   rrd_file=`dirname $f`/`basename $f .xml`.rrd
   mv -f "${rrd_file}" "${rrd_file}.bak"
   chown root:root "${rrd_file}.bak"
   rrdtool restore "$f" "${rrd_file}"
   chown munin:munin "${rrd_file}"
done

, , ,

  1. #1 by Halbert on July 2, 2009 - 21:24

    Hello,
    I didn’t realize you needed to dump your rrd files if you were migrating from a 32bit to a 64bit server. I can only assume a similar process is necessary if you go in the opposite direction, from 64 bit to a 32 bit server.

    In that case, would your export and import scripts work?

    Thanks

  2. #2 by lionel on July 8, 2009 - 21:54

    Hi Halbert,
    The scripts should work for a 64 to a 32 bit migration. But I did not try it myself.

(will not be published)