Skip to content

Hints for developers trying to migrate WP database with CJT tables

Home Support Support Tickets Hints for developers trying to migrate WP database with CJT tables

Viewing 1 reply thread
  • Author
    Posts
    • #10009

      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

    • #10065
      Damian Baker
      Participant

      Hi 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

Viewing 1 reply thread
  • You must be logged in to reply to this topic.