When I migrate from localhost to the server, I have to go in and manually save my field group in order for the block to render on the front end or the editor. Yes, I have run search and replace on the database. This will become a big nuisance when I have more than one block and switch between production and staging. I'm kinda bewildered that this is how MB works. What can be done?
If you want to use the block of the staging site in the production site with the builder, you can use the feature export/import of this extension. Get more details here https://docs.metabox.io/extensions/meta-box-builder/#export--import
Another way is to get the PHP code that creates the block, adds it to the file functions.php in the theme/child theme folder, or uses Code Snippets.
Long Nguyen, a staging or dev site is a duplication of a site, where all the files and database are copied over. After making changes, a staging site can be "pushed to production" on most platforms, where the database and files are copied back to the public site. Exporting and importing MB settings would be redundant to this process, and also quite a lot of hassle.
I'm wondering why MB requires me to go into the group and hit the Update button, just to work again after moving between dev/staging/production. This doesn't happen with ACF or most other plugins.
Thank you for your additional information.
Which's the staging plugin that you are using? If it's a premium plugin, please share a copy via this contact form https://metabox.io/contact/, I will help you to check it.
The problem happens when the database is copied and the site url changes. This happens whether I do the database migration manually or using a plugin. Export from localhost, import to staging server, search and replace the url. The custom block does not work on the front end or back end. It doesn't matter whether I use the Better Search Replace plugin or the search and replace tool from interconnect/it.
This is getting really annoying. I'm about ready to uninstall Metabox and switch to ACF. Under active development, I need to push changes from dev to staging frequently, and it's frustrating having to go in to each field group and re-save it.
I've just tried to do the migration from a site with a block created by MB Blocks & Meta Box Builder to another site. And after the migration, I still can edit the block on the backend and frontend without any problem.
Can you please share screenshots of the errors?
There are no error messages. The blocks just don't display on the front end or editor. WP_DEBUG is enabled. With SCRIPT_DEBUG enabled, there are no messages on the migrated site that are not also on the local site (all just jQuery deprecation notices).
I've tried to make a test case to reproduce the issue but no luck:
- Create a block with MB Builder on the site A
- Access to PHP MyAdmin and export database of site A
- Import it to site B and replace the URL
- The block on site B still works as well.
If it is possible, please share your site credentials via this contact form https://metabox.io/contact/. I will try to import your site data to my local site and check the issue.
Ok sure. The next time I work on the site, I'll set up a second staging site that illustrates the problem.