No devices showing after database migration

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

Moderators: Developers, Moderators

Post Reply
xion824
Posts: 2
Joined: Thu Jun 07, 2018 9:06 am

No devices showing after database migration

Post by xion824 »

Hopefully all you wonderful people can help me out here.

I just built a new Cacti server on RHEL 7. Migrated the database off an older version of Cacti on a CentOS 6 system. Copied all the rrd files over. But when I run cacti, none of my devices show up. When I look at the cacti database, "select description from host;" shows none of the info from the old database. I had no errors on import. Any ideas? Relevant info below:
------------------------
Old server info:
OS: CentOS 6.2
Cacti ver: 0.8.8a-1
DB: MySQL 5.1.52

New server info:
OS: RHEL 7.5
Cacti ver: 1.1.36-1
DB: MariaDB 5.5.56

DB export process:
- shut down pollers on both systems
- On old server:
mysqldump -u root -p cacti > /tmp/dump.sql
scp /tmp/dump.sql <new server:/tmp>
- On new server:
mysqldump -u root -p cacti < /tmp/dump.sql

Migrate RRD files:
- On old server:
mkdir /tmp/xml
cd /var/li/cacti/rra
for i in `find -name "*.rrd"`; do rrdtool dump $i > /tmp/xml/$i.xml; done
cd /tmp/xml
tar cvfz cacti-rrd.tgz *
scp cacti-rrd.tgz <new server:/tmp>
- On new server:
cp /tmp/cacti-rrd.tgz /var/lib/cacti/rra
cd /var/lib/cacti/rra
tar xvfz cacti-rrd.tgz
for i in `find -name "*.xml"`; do rrdtool restore $i `echo $i |sed s/.xml//g`; done

---------------------
What am I doing wrong??
On the old server when I go into mysql and do a "use cacti;" and then "select description for host;" I see all my devices I have. But doing the same on the new server only shows me localhost. Nothing else.
Appreciate the help! If any other info is needed, please ask.
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: No devices showing after database migration

Post by netniV »

You've copied the RRA folder into the normal one used by the Cacti package available under CentOS. However, I am assuming on the new server you have installed cacti manually? If so, the RRA folder will actually be under the cacti website folder.

I'm sure that the RRD's you could just copy, rather than export and re-import.

Aside from the RRD's / Graphs, are you seeing all the devices etc listed?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
xion824
Posts: 2
Joined: Thu Jun 07, 2018 9:06 am

Re: No devices showing after database migration

Post by xion824 »

Well, this is resolved. Bad source document for the steps to build this (contacted the author to make the change). I'm not a DB person by any means, so I was blindly following the steps provided. The import command to import the cacti database was incorrect.

incorrect:
mysqldump -u root -p cacti < /tmp/dump.sql

correct:
mysql -u root -p cacti < /tmp/dump.sql

:x ... at least it works. Everything works 100% now.
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: No devices showing after database migration

Post by netniV »

You know, I only skim read it so I missed that myself. Had I actually been carrying them out I would have seen it straight away because you can't import into a DB using dump as far as I know. At least it's resolved now :)
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
User avatar
lightstorm22
Posts: 1
Joined: Thu Mar 07, 2024 6:21 am

Re: No devices showing after database migration

Post by lightstorm22 »

I realize this is a very old post and sorry if this is bad form, but I had to say THANKS because I also am not a DB person nor do I install Cacti often, so I was doing exactly what xion824 was and could not figure it out until I found this thread.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests