Pro5 to Pro6 Migration

In this article, we're going to discuss common issues that arise and provide some help when migrating from Pro5 to Pro6.

  1. Running the migration with Raw SQL
  2. Workspace Defaults to the left side

The Post Type Change

The main difference from Pro5 to Pro6 is that custom layout types (Singles, Archives) no longer all use the same post_type cs_layout. They are broken out to separate post_types to make managing permissions and make adding new custom types easier. Due to the variety of plugins, this simple change can cause numerous issues depending on your setup so we offer alternatives.

If you are having issues upgrading to Pro 6 with layout content being missing, try the following steps.

Running the migration with Raw SQL

1.) Restore your database back to the Pro5 state.

2.) Add the following definition in your wp-config.php file (before the require of wp-settings.php). This internally will not use wp_update_post and instead will do raw SQL queries to move the post_types.

// This is definition NEEDS to be created before the wp-settings line define("CS_MIGRATE_UNTYPED_USE_RAW_UPDATE", true); // Example rest of the wp-config.php // only copy the above lines /** Sets up WordPress vars and included files. */ require_once ABSPATH . 'wp-settings.php';

3.) Upload Pro 6.2.0+ and activate it.

4.) If your layout content is fine, great. You can remove the line in #2.

5.) If you are not okay. Restore Pro5 and talk to Themeco or investigate what is wrong after migrating to Pro 6.

Changing the default UI preferences to match Pro5

Workspace Defaults to the left side

In a child theme or loaded through a plugin you can change the default preferences to have the Workspace side be the left similar to Pro5.

add_filter('cs_app_preference_defaults', function($defaults) { // Workspace defaults to left $defaults['workspace_side'] = 'left'; return $defaults; });

What if I had to downgrade to Pro 5?

You should restore your database. Downgrading the theme will have adverse sideeffects if you are using custom layouts. Clear your cache after a restore. You should be fine after this.

If that is not an option you'll need to change the post_type of those custom layouts back to the original cs_layout. If your WordPress prefix is wp_ for tables then this is the following update SQL you will use. Be careful. You should know what you are doing before doing this and feel free to contact us first.

UPDATE wp_posts SET post_type = 'cs_layout' WHERE post_type IN ( 'cs_layout_archive', 'cs_layout_single', 'cs_layout_archive_wc', 'cs_layout_single_wc' )

See something inaccurate? Let us know