Migration of Cacti From Old Server to New Server

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

Moderators: Developers, Moderators

hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Post by hid3 »

gandalf wrote:
hid3 wrote:I have the same problem. Importing and restoring old rrd files makes cacti not update them with data. Debug turned on just says something like "Waiting for poller 1/1". I've triple-checked all the permissions, ownership and etc - everything seems to be ok. Posted here a few posts earlier, however, my thread got no response.

Help me please.. I'm stuck with it already about 2 weeks.. :(
How did you "export/import/restore" your rrd files? Make sure, that you're not hitting an rrdtool problem (there have been issues when exporting/importing using different rrdtool versions)
Reinhard
My old cacti system has RRDtool 1.2.11, and the new one is RRDtool 1.3.1.

On my old system I execute this script:

Code: Select all

for i in `ls *.rrd`; do
    rrdtool dump $i > `basename $i .rrd`.xml
done
And then I tar the xml files in the directory, copy it to my new server and run rrdtool restore $i `basename $i .xml`.rrd.

Also, my old server is running MySQL 4.1.22 while the new one has 5.0.51a. Maybe that could be the problem? Any ideas are welcome! :oops:
User avatar
TheWitness
Developer
Posts: 17057
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

The way I typically do this is as follows:

1) Dump the database on the old system
2) Restore the database on the new system and get polling 100% operational while maintaining the old system in tact.
3) Once you have the new system polling well, then transfer the RRDfiles hot.

You need not be concerned about who's updating when, as when the XML -> RRD conversion takes place, it will be from current data.

Then, the problem as I see it with the method that you are using is with the command line length. The appropriate method is to have an infinite loop on the new server that checks the mount point on the old server where the XML files are being stored, convert's them to RRDfile and then deletes them.

On the Old server, you simply do the following:

Code: Select all

find /var/www/html/cacti/rra -name \*.rrd -exec dumpme.sh {} \;


The dumpme.sh binary is quite simple:

Code: Select all

#!/bin/bash
rrdtool dump $1 > /myexportpath/`basename $1`.xml
The infinite loop is similar:

Code: Select all

#!/bin/bash
while [ 1 ]; do
  for file in `ls -1 /mymountpoint/*.xml`;do
    rrdtool restore $file /mynewrrapath/`basename $file`.rrd
   /bin/rm -f $file
    echo "Restored '$file'"
  done
done
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
jbarbieri
Cacti User
Posts: 101
Joined: Tue May 24, 2005 8:46 am
Location: Rochester, New Hampshire
Contact:

Post by jbarbieri »

Just my $0.02 I am doing this right now


on the old server, I do

Code: Select all

 for i in *.rrd; do /usr/local/rrdtool-1.2.11/bin/rrdtool dump $i > $i.xml ; done




Then on the new server

Code: Select all

scp user@host:/usr/local/cacti/rra/*.xml .
for i in *.xml; do /usr/local/rrdtool-1.3.7/bin/rrdtool restore $i `basename $i .xml`; done

Been working great so far....I have been having to move one host at a time, and its quite simple with this process.
User avatar
TheWitness
Developer
Posts: 17057
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

The benefit to the process I use is:

1. No gaps
2. No downtime
3. Fault tolerant (you can do over and over again until you get it right)

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
jbarbieri
Cacti User
Posts: 101
Joined: Tue May 24, 2005 8:46 am
Location: Rochester, New Hampshire
Contact:

Post by jbarbieri »

TheWitness wrote:The benefit to the process I use is:

1. No gaps
2. No downtime
3. Fault tolerant (you can do over and over again until you get it right)

TheWitness
Well, you just have it done what I am doing in scripts.


And when I move to many files, not matter which method, I have gaps, heh. And there is no downtime, the old server is still up and running, and I have messed up a few times and just repeated the process.
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Post by hid3 »

Thank You all for help, looks like I solved my problem. It seems that RRDtool was the cause of it. My old one was 1.2.11 and new one was 1.3.1 as mentioned earlier. On my new system I compiled version 1.2.11 also and restored the XML's. Everything seems to work. I'll test everything a few more days and will try to upgrade the RRDtool probably.
amiller099
Posts: 4
Joined: Wed May 27, 2009 4:05 pm

Post by amiller099 »

I am migrating from Windows Server 2003 to Ubuntu 9.04.

I have the same cacti version(8.6i) and RRDtool(1.2.15) version installed on my new server.

I have successfully imported the mysql database.

Polling is broken, and I'm wondering how to troubleshoot that. I'm a bit of a newb so I don't really know where to begin troubleshooting.

My cron job looks like this. I just put all my cron stuff under the root account:
15 0 * * * /opt/nedi/startnedi.sh
*/5 * * * * cactiuser php /etc/cacti/poller.php > /dev/null 2>&1

cactiuser exists and *should* have proper permissions(i followed the doc). Path to cacti is correct also.

Suggestions?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

rrd files moved from one OS to another need to be converted. The cacti db should be fine, except for paths which will need to be updated.

There is a script somewhere on the forum that someone created that converts the rrd files. Basically an rrdtool dump to xml, then reimport on the new OS.
amiller099
Posts: 4
Joined: Wed May 27, 2009 4:05 pm

Post by amiller099 »

BSOD2600 wrote:rrd files moved from one OS to another need to be converted. The cacti db should be fine, except for paths which will need to be updated.

There is a script somewhere on the forum that someone created that converts the rrd files. Basically an rrdtool dump to xml, then reimport on the new OS.
Thanks. I will look around for the script.

I haven't really gotten that far yet tho. Polling is not currently working. I was hoping to get that running before I try to get the rrd files converted.
osolu
Posts: 1
Joined: Tue Jun 23, 2009 3:21 am

Migration of Cacti From Old Server to New Server

Post by osolu »

Hi Guys
I just successfully installed a new cacti server (Version 0.8.7a), old server is also running same version and both are Fedora Core 6 Linux.

Also wants to transfer all my old info on the old to the new, my questions are:
1. What exactly do i need to transfer from the old server to the new?: Cacti database on my mysql database? RRA files? Cacti log files?

2. Also where exactly (which location on the server) are the old graphs stored? are they on mysql database or the RRA files

Thanks

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

Post by gandalf »

This _has_ been answered umptiest times.
Do a mysqldump and restore on new target.
Do a mysql dump on all rrd files an a restore on new target
Do not forget to setup crontab.
Reinhard
zeki
Cacti User
Posts: 92
Joined: Fri Feb 09, 2007 10:55 pm
Location: So. Cal
Contact:

Re: Migration of Cacti From Old Server to New Server

Post by zeki »

i had to convert my rrd files today. Took forever to figure out why the graphs weren't generating. Should add it to the docs, "Migrating to new server." or add it in debugging.
Pretty useful information.
http://www.krypt.com/
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests