Issue restoring data

Good afternoon,

I am currently migrating an instance of Dolibarr (v 18.0.1) from my Linux home server (Ubunutu 20.04) to a new instance (v18.0.2) on Ionos web hosting.

I can migrate my documents folder without any issues. However, I am struggling to migrate the msqldump file. I have tried in the command line and also using the Ionos phpMyAdmin.

On command line, I enter:

mysql dbs123456789 -h db98765432.hosting-data.io -P 3306 -u username -pXXXXXXX < mysqldump_dolibarr_18.0.1_2310241426.sql

…and get the following error:

ERROR 3780 (HY000) at line 25: Referencing column 'fk_pcg_version' and referenced column 'pcg_version' in foreign key constraint 'fk_accounting_account_fk_pcg_version' are incompatible.

On phpMyAdmin, I use the import feature (and deselect ‘Enable foreign key checks’), but get the following error:

SQL query:


CREATE TABLE `llx_accounting_account` (
  `rowid` bigint NOT NULL AUTO_INCREMENT,
  `entity` int NOT NULL DEFAULT '1',
  `datec` datetime DEFAULT NULL,
  `tms` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `fk_pcg_version` varchar(32) NOT NULL,
  `pcg_type` varchar(20) NOT NULL,
  `account_number` varchar(32) NOT NULL,
  `account_parent` int DEFAULT '0',
  `label` varchar(255) NOT NULL,
  `labelshort` varchar(255) DEFAULT NULL,
  `fk_accounting_category` int DEFAULT '0',
  `fk_user_author` int DEFAULT NULL,
  `fk_user_modif` int DEFAULT NULL,
  `active` tinyint NOT NULL DEFAULT '1',
  `reconcilable` tinyint NOT NULL DEFAULT '0',
  `import_key` varchar(14) DEFAULT NULL,
  `extraparams` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`rowid`),
  UNIQUE KEY `uk_accounting_account` (`account_number`,`entity`,`fk_pcg_version`),
  KEY `idx_accounting_account_fk_pcg_version` (`fk_pcg_version`),
  KEY `idx_accounting_account_account_parent` (`account_parent`),
  CONSTRAINT [...]
MySQL said: Documentation

#3780 - Referencing column 'fk_pcg_version' and referenced column 'pcg_version' in foreign key constraint 'fk_accounting_account_fk_pcg_version' are incompatible.

Some help on how to resolve this would be greatly appreciated.

Thanks, Andrew

This has now been resolved by deleting the ‘llx_accounting_system’ table.

This help article said to also delete ‘llx_accounting_account’ but I did not have that table. Either way, deleting the ‘llx_accounting_system’ table made it work.