Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.63k stars 405 forks source link

Upgrade and migrate cacti 0.8.8 g to 1.2.1 (Error migrate cacti database) #2411

Closed fadhilrajabian closed 5 years ago

fadhilrajabian commented 5 years ago

Describe the bug Below are steps when i upgrade and migrate cacti 0.8.8 to 1.2.2;

  1. Install Cacti on the New Server
  2. Turn Off Cacti at the Old Server
  3. Migrate the Database
  4. Copy the RRD Files and change ownership all RRD files
  5. Activate the New Cacti
  6. Reactivate the Poller
  7. Run the command $ sudo vi /etc/cron.d/cacti
  8. Enable the poller by removing the character ‘#’ in front of the crontab entry then save & quitVisit the new site and set the mode to ‘Upgrade’

*after following the step of migrate database, i found this error

Screenshots

image

netniV commented 5 years ago

If you run that command manually, what does MySQL tell you?

fadhilrajabian commented 5 years ago

If you run that command manually, what does MySQL tell you?

hello, after that error , i try to delete column id, network_id, id, snmp_port ,and snmp engine. after that still have this error :

Failed to execute SQL : SQL ALTER TABLE automation_devices ADD COLUMN id BIGINT unsigned auto_increment FIRST, ADD COLUMN network_id INT unsigned NOT NULL default '0' AFTER id, ADD COLUMN snmp_port int(10) unsigned NOT NULL DEFAULT '161' AFTER snmp_version, ADD COLUMN snmp_engine_id varchar(30) DEFAULT '' AFTER snmp_context, DROP PRIMARY KEY, ADD PRIMARY KEY(id), ADD UNIQUE INDEX ip(ip); ADD INDEX network_id(network_id), COMMENT='Table of Discovered Devices'; failed : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ADD INDEX network_id(network_id), COMMENT='Table of Discovered Devices'' at line 1

Spev76 commented 5 years ago

I am getting the same error, but I also get an error just before this error image

cigamit commented 5 years ago

I can see how that might fail if you have already upgraded the system and are attempting to re-upgrade after trying to back off things. @Spev76, if you are still stuck, you should

delete from settings where name like 'automation%';

@fadhilrajabian, the process you are using is incorrect. Before you re-enable the poller do the following:

x-2) install all 1.x compatible plugins x-1) drop new Cacti database, create empty cacti database x) migrate database from old system x+1) login to Cacti site and upgrade the schema to the latest Cacti x+2) Re-enable cron

cigamit commented 5 years ago

Also, keep the old server running, you can rsync the files from the old server to the new server so that you get no gaps in your graphs. If you are running RRDtool 1.5+, it's be quite smooth.

cigamit commented 5 years ago

Things should be better with the release of 1.2.2. I would suggest the either of you do a post in the Forums "How-To" section on migrating to the new version of Cacti. I know that there are articles there already, but adding another one does not hurt.

fadhilrajabian commented 5 years ago

I can see how that might fail if you have already upgraded the system and are attempting to re-upgrade after trying to back off things. @Spev76, if you are still stuck, you should

delete from settings where name like 'automation%';

@fadhilrajabian, the process you are using is incorrect. Before you re-enable the poller do the following:

x-2) install all 1.x compatible plugins x-1) drop new Cacti database, create empty cacti database x) migrate database from old system x+1) login to Cacti site and upgrade the schema to the latest Cacti x+2) Re-enable cron

@cigamit that's step also already i have done, i already drop the cacti database and create cacti database and create empty cacti database afterthat migrate database from old system. but the result is still same.

fadhilrajabian commented 5 years ago

@cigamit thankyou for your help it works, my bad has activated the poller before the upgrade schema is complete.