Migration of Cacti From Old Server to New Server
Moderators: Developers, Moderators
Migration of Cacti From Old Server to New Server
I have just finished installing Cacti 0.8.6h with CentOS on my new powerful server, but have yet to have migrated the data from my old server. My old server is cacti 0.8.6h as well with FreeBSD.
I know I need to pull over my rra and log files for all of the past data. How exactly do I move the mysql information?
Is there anything else I need to do?
I know I need to pull over my rra and log files for all of the past data. How exactly do I move the mysql information?
Is there anything else I need to do?
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Dump the mysql database, and restore it on the new server.
You might also need to translate your rrdtool files. This process involves dumping them all to XML on the old server and importing them all into rrd files on the new server. Usually arch changes or OS changes require this action. FreeBSD to Linux probably requires this.
You might also need to translate your rrdtool files. This process involves dumping them all to XML on the old server and importing them all into rrd files on the new server. Usually arch changes or OS changes require this action. FreeBSD to Linux probably requires this.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Yea so it looks like I have a mess on my hands... after playing with this for the past 4 days I have encountered some new obstacles.
I am using a newer version of cacti with plugins that require the mysql database to stay in tact. So If I simply copy over the top of the existing database on the new server, then it will break my new configuration of cacti. (But the server items will import in the gui)
Is there a trigger or a way to import only the device data into my new cacti installation without affecting the new configuration?
I am new to translating my rrdtool files, how exactly do I do this? What exactly does it do? Any example commands?
Thanks for your time helping me solve this. I greatly appreciate it.
I am using a newer version of cacti with plugins that require the mysql database to stay in tact. So If I simply copy over the top of the existing database on the new server, then it will break my new configuration of cacti. (But the server items will import in the gui)
Is there a trigger or a way to import only the device data into my new cacti installation without affecting the new configuration?
I am new to translating my rrdtool files, how exactly do I do this? What exactly does it do? Any example commands?
Thanks for your time helping me solve this. I greatly appreciate it.
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
First, start with an install that is without plugins, matching your current install. That will resolve most of the issues you have encountered.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Well with that in mind, I still need to use the rrdtool dump command in order to to move my .rrd files. Here are the commands I am using:
rrdtool dump filename.rrd > filename.xml
rrdtool restore filename.xml > filename.rrd
Thats great and all, but I have over 400 .rrd files to do this to. Is there a faster way rather than going from file to file?
rrdtool dump filename.rrd > filename.xml
rrdtool restore filename.xml > filename.rrd
Thats great and all, but I have over 400 .rrd files to do this to. Is there a faster way rather than going from file to file?
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Use a script.. Something like...
Create XML files:
Restore RRD files:
Run the first command in the rra directory. It will generate the XML files that you move over to the new server, then run the second command to remake the rrdtool files.
Disclaimer, I wrote these without testing them. To test, just don't add the final pipe to the end so that you can see the resulting commands that would be executed.
Create XML files:
Code: Select all
ls -1 *.rrd | awk '{print "rrdtool dump "$1" > "$1".xml"}' | sh -x
Code: Select all
ls -1 *.rrd.xml | sed 's/\.xml//' | awk '{print "rrdtool restore "$1".xml "$1}' | sh -x
Disclaimer, I wrote these without testing them. To test, just don't add the final pipe to the end so that you can see the resulting commands that would be executed.
Last edited by rony on Tue May 23, 2006 6:40 pm, edited 1 time in total.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Code: Select all
ERROR: usage rrdtool restore [--range-check/-r] [--force-overwrite/-f] file.xml file.rrd
+ rrdtool restore yoda_hdd_total_890.rrd.xml
ERROR: usage rrdtool restore [--range-check/-r] [--force-overwrite/-f] file.xml file.rrd
+ rrdtool restore yoda_hdd_total_891.rrd.xml
ERROR: usage rrdtool restore [--range-check/-r] [--force-overwrite/-f] file.xml file.rrd
+ rrdtool restore yoda_proc_886.rrd.xml
ERROR: usage rrdtool restore [--range-check/-r] [--force-overwrite/-f] file.xml file.rrd
+ rrdtool restore yoda_traffic_in_894.rrd.xml
ERROR: usage rrdtool restore [--range-check/-r] [--force-overwrite/-f] file.xml file.rrd
+ rrdtool restore yoda_traffic_in_895.rrd.xml
ERROR: usage rrdtool restore [--range-check/-r] [--force-overwrite/-f] file.xml file.rrd
+ rrdtool restore yoda_traffic_in_896.rrd.xml
ERROR: usage rrdtool restore [--range-check/-r] [--force-overwrite/-f] file.xml file.rrd
+ rrdtool restore yoda_traffic_in_897.rrd.xml
ERROR: usage rrdtool restore [--range-check/-r] [--force-overwrite/-f] file.xml file.rrd
+ rrdtool restore yoda_users_885.rrd.xml
ERROR: usage rrdtool restore [--range-check/-r] [--force-overwrite/-f] file.xml file.rrd
[root@localhost rra]# ls -1 *.rrd.xml | sed 's/\.xml//' | awk '{print "rrdtool restore "$1".xml > "$1}' | sh -x
Is there a typo in this second 'script' that is causing these errors?
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Yes, use this syntax...
Restore RRD files:
But first, you might want to delete *.rrd from the rra directory.
I was lazy, didn't pay attention to the rrdtool restore syntax, sorry..
Restore RRD files:
Code: Select all
ls -1 *.rrd.xml | sed 's/\.xml//' | awk '{print "rrdtool restore "$1".xml "$1}' | sh -x
I was lazy, didn't pay attention to the rrdtool restore syntax, sorry..
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Just to thank you for this helprony wrote:Yes, use this syntax...
Restore RRD files:But first, you might want to delete *.rrd from the rra directory.Code: Select all
ls -1 *.rrd.xml | sed 's/\.xml//' | awk '{print "rrdtool restore "$1".xml "$1}' | sh -x
I was lazy, didn't pay attention to the rrdtool restore syntax, sorry..
| Cacti 0.8.6i | Cactid 8.6i |
| Centos 4.4 | PHP 4.3.9 | httpd 2.0.52 | RRDtool 1.2.15 | MySQL 4.1.20 | Net-SNMP 5.1.2 | Dell 1650 | 1 gig RAM|
| Centos 4.4 | PHP 4.3.9 | httpd 2.0.52 | RRDtool 1.2.15 | MySQL 4.1.20 | Net-SNMP 5.1.2 | Dell 1650 | 1 gig RAM|
Able to import old, unable to poll new data
I successfully imported MySQL data from my source server, and Cacti polls and fills in data as expected.
I then remove the newly generated .rrd files and replace them with .rrd files generated from an .xml export (as describe above). The old data shows up fine in Cacti, but no new data is saved.
As far as I can tell the poller appears to be working, and the .rrd permissions are set properly. Any suggestions?
Cacti 0.8.7a
PHP 5.1.6
RHEL 5.1 (2.6.18-53.1.6.el5)
I then remove the newly generated .rrd files and replace them with .rrd files generated from an .xml export (as describe above). The old data shows up fine in Cacti, but no new data is saved.
As far as I can tell the poller appears to be working, and the .rrd permissions are set properly. Any suggestions?
Cacti 0.8.7a
PHP 5.1.6
RHEL 5.1 (2.6.18-53.1.6.el5)
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Change crontab entry from to
Now you'll find results of rrdtool statements in that very log. Please analyze it
Reinhard
Code: Select all
... php -q /var/www/html/cacti/poller.php > /dev/null 2>&1
Code: Select all
... php -q /var/www/html/cacti/poller.php > /var/www/html/cacti/log/poller.log 2>&1
Reinhard
-
- Posts: 2
- Joined: Mon Apr 06, 2009 8:22 am
I'm having the same problem. I looked at that log and it's empty. Please help!gandalf wrote:Change crontab entry fromtoCode: Select all
... php -q /var/www/html/cacti/poller.php > /dev/null 2>&1
Now you'll find results of rrdtool statements in that very log. Please analyze itCode: Select all
... php -q /var/www/html/cacti/poller.php > /var/www/html/cacti/log/poller.log 2>&1
Reinhard
-
- Posts: 2
- Joined: Mon Apr 06, 2009 8:22 am
I got it working. I had to chown the rra folder:alanstrand wrote:I'm having the same problem. I looked at that log and it's empty. Please help!gandalf wrote:Change crontab entry fromtoCode: Select all
... php -q /var/www/html/cacti/poller.php > /dev/null 2>&1
Now you'll find results of rrdtool statements in that very log. Please analyze itCode: Select all
... php -q /var/www/html/cacti/poller.php > /var/www/html/cacti/log/poller.log 2>&1
Reinhard
chown www-data:www-data *
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..
Help me please.. I'm stuck with it already about 2 weeks..
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
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)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..
Reinhard
Who is online
Users browsing this forum: No registered users and 4 guests