I use a number of open-source tools that rely on rrdtool to generate graphs. Cacti uses it for its core functionality. BackupPC uses it to graph storage pool usage over time. Unfortunately, the files it generates are architecture-dependent. This means that if you upgrade your BackupPC server from i386 to amd64, your pool graphs will mysteriously disappear. Shall we fix that?
This problem is easy to verify. Login to your server and inspect one of its RRD files.
root@backuppc:~# cd /var/lib/backuppc/log root@backuppc:/var/lib/backuppc/log# rrdtool info pool.rrd ERROR: This RRD was created on other architecture
To correct it, export the RRD files to XML format before * upgrading the server:
rrdtool dump pool.rrd > pool.xml
* What if you’ve already upgraded? You can use any other server with the same architecture. Just copy your RRD files to it and run the same commands there.
After upgrading, import your XML files into the new RRD format:
rrdtool restore -f pool.xml pool.rrd
The above example is for BackupPC, but these commands work for any RRD file. If you have a lot of files (such as on a Cacti server), here is a handy loop:
for i in *.rrd; do rrdtool dump $i > $i.xml ; done
And another for restoring:
for i in *.xml; do rrdtool restore -f $i `basename $i .xml`.rrd ; done
Don’t forget to set expected file ownership and permissions (
chown --reference and
chmod --reference are your friends), and remove the XML files afterward.