I'm trying to upgrade an old database from cacti 0.8.8h to the last version 1.2.25 (from the 1.2.x branch from git) on a new server (with MariaDB 10.5 and PHP 7.4).
I have followed theses steps from https://docs.cacti.net/Upgrading-Cacti.md :
- backup old database and files from the old server
- copy files on the new server and extract 1.2.x zip branch over the old files
- changes permissions
- import backup.sql on the new server (having changed cacti install path with sed before import)
- run the upgrade wizard
It worked fine for the first upgrade but loop to the "Upgrade from v1.0.4 to v1.0.5".
So I tried to execute the upgrade from cli :
Code: Select all
# php -q cli/upgrade_database.php --forcever=1.0.4
NOTE: Repairing Tables for Local Database
Upgrading from v1.0.4
Upgrading from v1.0.4 (DB 1.0.4) to v1.0.5
x++++++++++++
################################
[Fail] - DB Exec Failed!, Error 1062: Duplicate entry '105-19-redactedredactedredacted-32.47.48.49.59.60..................' for key 'PRIMARY'
+------------------------------+
ALTER TABLE host_snmp_cache MODIFY COLUMN snmp_index varchar(191) NOT NULL default ""
################################
ERROR 1265 (01000): Data truncated for column 'snmp_index' at row 7014
From my understanding the script is trying to reduce the column snmp_index from varchar(255) to varchar(191) to be compliant with some standard ?
But in my case, I have a lot of value that exceed this maximum, so it created duplicate entry on this colomn ?
Code: Select all
MariaDB [cacti]> select * from host_snmp_cache where CHAR_LENGTH(snmp_index) >191;
3240 row in set (0,328 sec)
Thank you for your help