Support » Plugin: Block Lab » Migration Issue to Genesis Blocks

  • Resolved aaron13223

    (@aaron13223)


    Hey there,

    I just updated and saw the message to transition to Genesis Custom Blocks. So, I just tried migrating and it doesn’t work. All the blocks in block lab were deleted. I get a migration error:

    The following error ocurred:
    
    <p>There has been a critical error on your website.</p><p><a href="https://wordpress.org/support/article/debugging-in-wordpress/">Learn more about debugging in WordPress.</a></p>

    The Genesis Custom Blocks don’t work either. It has a menu item but the only sub menu item there is “Documentation” & “Genesis Pro”.

    My website has over 3000 posts and each post has multiple blocks so I’m really worried about this transition. I would really grateful if you could help me out.

    And yes the developer notice link for migration doesn’t work either: https://getblocklab.com/migrating-to-genesis-custom-blocks/

    • This topic was modified 1 month, 3 weeks ago by aaron13223. Reason: extra info
Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @aaron13223,
    Wow, sorry about that. 3000 posts…

    Where did that error occur? During the migration process?

    https://cldup.com/sxRZu0yyig.png

    If so, at what step?

    Thanks, I’m here to work through this with you.

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Also, after a hard refresh, do these menu items appear? They should have the blocks.

    https://cldup.com/Y98D2sFp_z.png

    Hey Ryan,

    Thanks for the quick turnaround. I did the “Empty Cache & Hard Reload” in chrome but there are no menu items to check the blocks in Genesis Custom blocks.

    As for the error, here’s the screenshot: https://ibb.co/yPGQvr3

    Thank you so much for your help.

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Thanks, @aaron13223!

    OK, so there was an error in migrating the post types or post content.

    Hm, do you have access to the PHP error log?

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Also, thanks for pointing out the ‘Developer notice’ link issue. It’s live now:
    https://getblocklab.com/migrating-to-genesis-custom-blocks/

    Hey,

    I just checked the nginx error log and it said that the memory was exhausted. I increased the execution time and increased the memory limit to 1024M in php and WordPress. But the migrating keeps on going forever and as soon as I refresh, I get a 504 error.

    Here’s the error in nginx now:

    2020/09/02 22:07:14 [error] 4012274#4012274: *374 upstream timed out (110: Connection timed out) while reading response header from upstream, client: x.x.x.x, server: example.com, request: “POST /wp-json/block-lab/migrate-post-content?_locale=user HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.4-fpm.sock”

    And it broke the website after this, did a full restore….

    Thanks for your help.

    • This reply was modified 1 month, 3 weeks ago by aaron13223.
    • This reply was modified 1 month, 3 weeks ago by aaron13223.
    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @aaron13223,
    Thanks a lot for the nginx log.

    Would you be up for trying a WP-CLI command? Please activate Block Lab and deactivate Genesis Custom BLocks before doing it.

    wp shell
    ( new Block_Lab\Admin\Migration\Post_Content( ‘block-lab’, ‘genesis-custom-blocks’ ) )->migrate_all();

    …and you might have to ensure the single quotes are correct, sometimes they’re changed to backticks here.

    From the nginx log, it looks like it timed out, which we’d expect in a migration of 3,000 posts. In my local, it took about 3 minutes to migrate 3,000 posts. That command above will probably take a few minutes also, and you might have to run it a few times.

    But I tried to have better handling of timeouts. It looks like it didn’t work on your site, sorry.

    https://github.com/getblocklab/block-lab/blob/1ae868ed6edb6eca082b0ef5e9a1b3ce74ec86c9/js/migration/components/steps/migrate-blocks.js#L84

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    If that succeeds, you might have to do this to migrate the block_lab post type:

    
    ( new Block_Lab\Admin\Migration\Post_Type( 'block_lab', 'block-lab', 'block_lab', 'genesis_custom_block', 'genesis-custom-blocks', 'genesis_custom_blocks' ) )->migrate_all();
    

    This should’t take nearly as long. It will migrate all of the blocks under /wp-admin > Block Lab > All Blocks.

    @aaron13223 May I suggest doing all the testing on a test copy of your site? Since the plugin is making a big change, it’s best to be careful and weed out the bugs before updating production.

    @ryankienstra 1024M is way too large for many websites. Is there a way to chunk the migration and maybe run it in the background, for the benefit of small configurations?

    Hey Ryan,

    I tried the wp cli and I get these errors: http://txt.do/1fy3b and so it fails.

    As for the timeout, how do you think I can counter that? I set the execution time to 3000s. Still the timeout.

    Just for extra information, my website is based on a LEMP Stack and I also use cloudflare pro plan. I also have wordfence plugin installed, but deactivating that doesn’t fix the issue.

    @galbaras I did try it on a test website as well, getting the same timeout. A lot of the small websites don’t have 3000+ posts, so I don’t think the ram might be an issue…

    Thank you so much for your help!

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @galbaras,

    @ryankienstra 1024M is way too large for many websites.

    Thanks for your ideas. The RAM probably isn’t the issue here. It queries for 10 posts at a time: https://github.com/getblocklab/block-lab/blob/1ae868ed6edb6eca082b0ef5e9a1b3ce74ec86c9/php/admin/migration/class-post-content.php#L140

    Is there a way to chunk the migration and maybe run it in the background, for the benefit of small configurations?

    Hm, it’s not ideal, but re-running that WP-CLI command when it times out worked in my local.

    It migrates different posts every time you run it, so if you run several times, it should be able to migrate the site.

    Plugin Author Ryan Kienstra

    (@ryankienstra)

    Hi @aaron13223,
    Thanks for the screenshot of the errors from running WP-CLI.

    Could you double-check the single quotes? Sometimes they’re converted to backtics in this forum.

    This error might be from that:

    PHP Warning: Use of undefined constant block – assumed ‘block’ (this will throw an Error in a future version of PHP) in phar:///usr/local/bin/wp/vendor/wp-cli/shell-command/src/WP_CLI/Shell/REPL.php(46) : eval()’d code on line 1

    
    wp shell
    ( new Block_Lab\Admin\Migration\Post_Content( 'block-lab', 'genesis-custom-blocks' ) )->migrate_all();
    ( new Block_Lab\Admin\Migration\Post_Type( 'block_lab', 'block-lab', 'block_lab', 'genesis_custom_block', 'genesis-custom-blocks', 'genesis_custom_blocks' ) )->migrate_all();
    
    
    Plugin Author Ryan Kienstra

    (@ryankienstra)

    If the command succeeds, you should see something like this each time the Post_Content command runs:

    
    => array(2) {
      ["successCount"]=>
      int(1000)
      ["errorCount"]=>
      int(0)
    }
    

    Hey Ryan,

    Really sorry for the mistake. Seems like the backticks were the issue. I just ran the command you provided in wp shell but it’s been stuck for the last 20 minutes or so.

    I see no message, but the website still seems to be up and running.`

    Thanks for the help.

    Hey Ryan,

    For some reason, It worked this time by normally migrating through the wordpress dashboard……

    I checked everything else seems totaaly normal and functional.

    One quick question, genesis blocks aren’t going anywhere, right??

    Thank you so much for your help!!

Viewing 15 replies - 1 through 15 (of 24 total)
  • You must be logged in to reply to this topic.