Home › Forums › Support Tickets › Hints for developers trying to migrate WP database with CJT tables
Tagged: hint, SQL error, WP migration problem
- This topic has 1 reply, 2 voices, and was last updated 11 years, 3 months ago by Damian Baker. 
- 
		AuthorPosts
- 
		
			- 
July 14, 2014 at 10:20 PM #10009Sylwia Fudalej-Pietrzak ParticipantHi 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
- 
July 17, 2014 at 2:16 PM #10065Damian Baker ParticipantHi Sylwia, Thank you so much for providing this important information, which I am sure will help others. On a similar note, we are hoping to release the import/export feature in the near future, and this will allow you to transfer across all your code blocks, code files, script templates, and script packages into another WordPress install with CJT Pro or Dev. Enjoy your day. Kind Regards, 
 Damian
 
- 
- 
		AuthorPosts
- You must be logged in to reply to this topic.
 
								 
								