Views:

Behavior:
When attempting to restore a MySQL DocuWare backup, the following MySQL error is displayed:

 CREATE TABLE `dwconnectionlicense` (
  `clid` char(36) NOT NULL,
  `slid` char(36) NOT NULL,
  `orgid` int(11) default NULL,
  `guid` char(36) NOT NULL,
  `end_of_license` datetime NOT NULL,
  `checksum` varchar(50) NOT NULL,
  PRIMARY KEY  (`guid`),
  KEY `dwfk_1c1d95f25a1106a4d66b1fdc6` (`slid`),
  CONSTRAINT `dwfk_1c1d95f25a1106a4d66b1fdc6` FOREIGN KEY (`slid`) REFERENCES `dwserverlicense` (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

The server has returned this error message: Cannot add foreign key constraint
MySQL Error.


Solution:

This occurs when your restore tries to overwrite pre-existing database tables. To resolve this issue, drop any pre-existing database schemas before you restore them.
***NOTE: Make sure you have complete backups of your DocuWare databases before following any of the following steps.***

  • Log into either Workbench or MySql administrator, locate and select all DocuWare databases that begin with "dw" and select "Drop 4 Schemas."

                        Work Bench
                       

 

  • In MySql Administration, repeat the previous step for all DocuWare databases.

     

Proceed to restore your backup, which should be completed successfully. 
​​​​​​​​​​​​

KBA is applicable for On-premise Organizations ONLY.