Migrating custom blocks from staging to live website

Support MB Blocks Migrating custom blocks from staging to live website

  • This topic has 3 replies, 2 voices, and was last updated 1 week ago by PeterPeter.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #48584
    ArnoArno
    Participant

    Hi,

    I am creating custom blocks on a staging site. Each block consists of a Field Group and a View. To migrate them to the live website, I wanted to export the Views and Field Groups and import them into the live site.

    I have done this before with Views, and it works fine. But the export for a Field Group contains a path to the staging site:

    {
        "$schema": "https://schemas.metabox.io/field-group.json",
        "block_json": {
            "enable": true,
            "path": "/home/<strong>staging</strong>/public_html/wp-content/themes/kadence_child/blocks",
            "version": "v1753016150"
        },

    I suppose that will cause issues when imported into another website? How do I do this?

    Kind regards,
    Arno

    #48589
    PeterPeter
    Moderator

    Hello Arno,

    It is the option to generate the file block.json in a specific folder for a field group. If you are worried about this path, you can edit the field group > go to Settings tab > disable this option > export the field group and import it to another site.
    This won't cause any issues when importing the field group to another site.

    #48595
    ArnoArno
    Participant

    Hi Peter,

    Thank you. So, I need to disable the option "Generate block.json" on staging, create the export file, import it into the live site?

    Should I then enable "Generate block.json" on the live site? It won't work without a block.json file, I suppose?

    #48600
    PeterPeter
    Moderator

    Hello,

    If you don't use some features of block.json, you can enable/disable it without affecting the custom block created with the builder. Please read more about block.json in this article https://metabox.io/mb-blocks-register-block-using-json-file/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.