Restoring Cacti Database to a Windows Server

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
tonybemidji
Posts: 9
Joined: Wed Mar 28, 2012 3:03 pm

Restoring Cacti Database to a Windows Server

Post by tonybemidji »

I have a working Cacti install running on a Windows XP workstation (just as a test). I want to move everything to a 2003 server that I have resurrected for this purpose. I've done a bit of configuration and would prefer to just backup and restore instead of starting from scratch.

So I backed up my working database: mysqldump -u root -p -l --add-drop-table cacti > mybackupfile
and saved it to a usb drive along with the entire Inetpub\wwwroot\cacti directory.

Using the combined installer I've installed 0.8.8a on the new server and tested that it is running fine with the default config.

So I then attempted to restore the backup to the new server: mysqldump -u root -p cacti < mybackupfile
Several lines scrolled by, so I assumed that everything went fine. I also copied the rra and scripts directories from the old server to the new, but when I go to http://localhost/cacti I have to log with the default username and password and see the default data.

I'm sure I missed something here, but am not quite sure what. Ideas?
User avatar
websniper
Posts: 11
Joined: Tue Jun 05, 2012 9:42 am

Re: Restoring Cacti Database to a Windows Server

Post by websniper »

I am not big on Windows but this sounds like a security / permissions issue. I would start looking there first. I hope this helps, I see no-one responded so I thought I would throw in my 2 cents worth for free.

Good Luck
"Knowledge can be dangerous in the wrong hands, wisdom must be added to protect the idiots!" -- me
User avatar
websniper
Posts: 11
Joined: Tue Jun 05, 2012 9:42 am

Re: Restoring Cacti Database to a Windows Server

Post by websniper »

Also make sure your database logins are the same in the config.php for the old database. Config.php may be a different name in Windows <- not sure
"Knowledge can be dangerous in the wrong hands, wisdom must be added to protect the idiots!" -- me
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Restoring Cacti Database to a Windows Server

Post by BSOD2600 »

You didn't use the correct mysql command to import the database. You should've used:
mysql --user=root --password cacti < c:\apache2\htdocs\cacti\cacti.sql
tonybemidji
Posts: 9
Joined: Wed Mar 28, 2012 3:03 pm

Re: Restoring Cacti Database to a Windows Server

Post by tonybemidji »

BSOD2600 wrote:You didn't use the correct mysql command to import the database. You should've used:
mysql --user=root --password cacti < c:\apache2\htdocs\cacti\cacti.sql
Sorry BSOD... I'm not sure I follow.

I backed up my old database and called it cactibackup.sql. I then copied that backup to c: on the new server.

So I assumed that I had to point mysql to that backup file in order to get it to restore:

mysql -u root -p cacti < c:\cactibackup.sql

Is this not correct?

Also... the backup is from an 8.7.i install and I am trying to restore it to an 8.8a install. Does this matter?
tonybemidji
Posts: 9
Joined: Wed Mar 28, 2012 3:03 pm

Re: Restoring Cacti Database to a Windows Server

Post by tonybemidji »

Ah... never mind. I'm guessing you were just referring to the general syntax... not necessarily the file name. I can see by watching the MYSQL Server data directory that the restore is taking place.

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

Re: Restoring Cacti Database to a Windows Server

Post by BSOD2600 »

tonybemidji wrote:I backed up my old database and called it cactibackup.sql. I then copied that backup to c: on the new server.

So I assumed that I had to point mysql to that backup file in order to get it to restore:

mysql -u root -p cacti < c:\cactibackup.sql

Is this not correct?
Correct. However in your OP stated the following which is wrong:
tonybemidji wrote:So I then attempted to restore the backup to the new server: mysqldump -u root -p cacti < mybackupfile
tonybemidji wrote:Also... the backup is from an 8.7.i install and I am trying to restore it to an 8.8a install. Does this matter?
Not really. Cacti should detect it needs to upgrade itself and will do so the next time you access the website.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest