Templates missing after upgrade 1.7 -> 1.9

I confirmed I had 4 templates, then upgraded from 1.7 (not 1.7.x) to 1.9 using the standard UI automatic update -- no templates are there now. The DB table uvwp_nbt_templates is empty.

The upgrade code does not appear to have a case for upgrading < 1.7:
if ( $current_version && version_compare( $current_version, '1.7.2' ) == -1 ) {

Any way to migrate the settings?

  • Patrick

    Hi @bhubbard

    Note that New Blog Templates now its own menu in network admin.

    It sounds like something went wrong during the update (cryptic, I know).

    I just updated from 1.8 to 1.9 on one of my test sites with no issues.

    I then deleted version 1.9 and re-installed version 1.7, and auto-updated to v1.9 again. My templates are still there.

    Please try deactivating and deleting the plugin. Then re-install again.

  • trish

    I've tried that with no luck. I had to roll my database back (which resets the stored plugin version), upgrade to 1.8, then upgrade to 1.9.

    The source of the problem is:
    When upgrading from 1.7, blogtemplatefiles/blogtemplates.php::maybe_upgrade() line 131
    $current_version = get_site_option( 'nbt_plugin_version', false );
    yields false/null, and there is no handler for this case that actually migrates the settings (if ( ! $current_version ) does not do any upgrading) .

  • Ignacio

    Hi @bhubbard.

    Sorry to hear that. I'll change the way NBT is upgraded in next release.

    Did you manage to upgrade the plugin? There's a little trick to upgrade it. You just need to place this code inside your functions.php file in the Main blog theme:

    function upgrade_new_blog_templates() {
       $model = blog_templates_model::get_instance();

    NBT must be activated.


  • Ignacio

    Hi @bhubbard.

    I've been checking the code and there was some more wrong code in the upgrading system. I've attached here a new beta (1.9.1) of the plugin. It should work now but if you want to test it you'll need the old values of your database as it is possible that you could have lost them. The DB values are:

    in wp_sitemeta:
    meta_key = 'blog_templates_options'

    and you'll need to delete this meta_key in wp_sitemeta too:

    So, these are the steps you'll need to follow:
    1. Remove the blogtemplates folder inside your plugins folder
    2. Add the blog_templates_options key froman old backup of your DB (I hope you have one)
    3. Remove the nbt_plugin_version meta_key.
    4. Unzip and upload the new attached plugin.
    5. Refresh the website and go to the NBT menu.

    Sorry for the inconveniences.