Import RRD file From win32

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Decombej
Posts: 20
Joined: Fri Jun 23, 2006 9:51 am
Location: Lyon, France

Import RRD file From win32

Post by Decombej »

I just re installed cacti on a Debian 3.1, and i'd like to import my old .RRD files from a win32 server.


So i copy them via scp in /var/lib/cacti/rra, i set the good permissions and owner, but nothing changes in cacti...

So my questions are:

1) Did i missed something?
2) Is it possible to import some w32files on linux, and still be readable?



Thanks,
Decombej
Posts: 20
Joined: Fri Jun 23, 2006 9:51 am
Location: Lyon, France

Come on!

Post by Decombej »

Anybody?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Import RRD file From win32

Post by gandalf »

Decombej wrote:I just re installed cacti on a Debian 3.1, and i'd like to import my old .RRD files from a win32 server.
Were those files part of an old cacti install? Then you'll have to export/import the cacti db to show those rrd files
So i copy them via scp in /var/lib/cacti/rra, i set the good permissions and owner, but nothing changes in cacti...
If those are pure external rrd's (not known by and not updated by cacti), please follow http://forums.cacti.net/viewtopic.php?t=12202. And pay attention: When copying rrd files between architectures, you'll get a problem. Instead, export/import them
Reinhard
Decombej
Posts: 20
Joined: Fri Jun 23, 2006 9:51 am
Location: Lyon, France

Post by Decombej »

Thanks a lot to answer, but i've already found a way to make it work.


I'll post the full procedure, i guess it could be usefull for some people.

=)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Decombej wrote:Thanks a lot to answer, but i've already found a way to make it work.


I'll post the full procedure, i guess it could be usefull for some people.

=)
Fine, that would really be appreciated
Reinhard
Decombej
Posts: 20
Joined: Fri Jun 23, 2006 9:51 am
Location: Lyon, France

HOWTO: Import/export Cacti DB and RRDs

Post by Decombej »

I had to migrate Cacti from a Windows to a Linux Based OS, i chose a Debian 3.1.

I met some difficulties when migrating old cacti data to the new server, i just copied rrd files via scp, set the correct permissions on the files, so the poller can read/write on rrds, and nothing happened.

With some searchs, i found that i had to import/exports rrds and the database (especially if you change your rrdtool version.)

To Import/Export RRDs (All datas are copied on the new server, let's say a temp directory):

Code: Select all

ls -1 *.rrd | awk '{print "rrdtool dump "$1" > "$1".xml"}' | sh -x
Be carefull to put the full path of rrdtool (in "...{print "rrdtool dump "$1..." if you have more than one version installed)
and to restore:

Code: Select all

ls -1 *.rrd.xml | sed 's/\.xml//' | awk '{print "rrdtool restore "$1".xml "$1}' | sh -x
Copy the new data to your rra directory, verify the permissions on the files (chown cactiuser /var/www/cacti/rra/* (user used to run the poller))

You now have to dump the old cacti db on the old server:

Code: Select all

mysqldump -u user -p oldcactidb > cacti_export.sql
and import it on the new server:

Code: Select all

mysql -u user -p newcactidb < cacti_export.sql
It's best to dump only some tables, in order to keep the settings table for exemple.
for that:

Code: Select all

mysqldump -u user -p oldcactidb tables > cacti_table_export.sql
You'll have to delete the table you want to replace before importing, or use the "--add-drop-table" option to mysqldump when exporting, like this:

Code: Select all

mysqldump --add-drop-table -u user -p oldcactidb > cacti_export.sql
But be carefull whit that...

In any case, do a backup before every step...

Hopping it'll be usefull for someone.
Long live Cacti and it's community! :D
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests