Hi Damian,
To anybody reading this post: you modify SQL database at your own risk. Please be cautious.
THE PROBLEM (CJT v. 7.1, WP 3.9.x)
When migrating or restoring from backup a WordPress database there exist the duplicate keys problem with the following CJT tables: ‘wp_cjtoolbox_blocks’ and ‘wp_cjtoolbox_templates’.
THE SOLUTION
Before importing WP database to a new location I have made two simple modifications.
1. After SQL command
CREATE TABLE ‘wp_cjtoolbox_blocks’
I change next SQL command
UNIQUE KEY ‘name’
to
KEY ‘name’
2. After SQL command
CREATE TABLE ‘wp_cjtoolbox_templates’
I change next SQL command
UNIQUE KEY ‘guid’
to
KEY ‘guid’
Et voila! The duplicate keys errors have gone away.
So far so good. But there is still another problem.
THE PROBLEM (CJT v. 7.1, WP 3.9.x)
After an import of database to a new location the CJT plugin shows no code blocks.
THE SOLUTION
After migration we should execute the following SQL command:
UPDATE ‘wp_cjtoolbox_blocks’ SET ‘parent’=NULL;
UPDATE ‘wp_cjtoolbox_blocks’ SET ‘backupId’=NULL WHERE ‘backupId’=’0’;
Finally we can see all our precious blocks of code. 🙂
Maybe the method described above will be useful to somebody.
Kind regards.
Sylwia