Documentation
Feedback
Guides
Storefront Development

Storefront Development
Store FrameworkUpdating live storesMigrating CMS settings after a Store Theme major update
Migrating CMS settings after a major theme update

When making changes to the peer dependencies of your Store Theme app, you may need to perform a major update. However, transitioning to a new major version of the Store Theme may lead to undesired consequences, such as losing the configured Admin page template settings.

To handle this situation, follow the steps below to migrate template settings.

hese instructions must be followed even when downgrading to a previous major theme version, such as from 5.x to 4.x.

Before you begin

Make sure you have the following tools installed on your machine. They facilitate interactions with the VTEX platform and enhance your development experience:

  1. Install the VTEX IO CLI.

  2. Install GraphQL IDE by running the following command:


    _10
    vtex install vtex.admin-graphql-ide@3.x

Instructions

  1. Open the terminal and log in to your account.

  2. Switch to the production workspace with your latest changes, and publish a new major version of your Store Theme app.

  3. In the production workspace, install the Store Theme version published in the previous steps by running the following command:


    _10
    vtex install {appVendor}.{appName}@{appVersion}

  4. Open the VTEX Admin of the production workspace used in the previous steps and go to GraphQL Admin IDE:


    _10
    vtex browse admin/graphql-ide

  5. From the Choose an app dropdown list, select vtex.pages-graphql@2.x.

  6. Copy the code below and paste it into the GraphQL IDE.


    _10
    mutation{
    _10
    updateThemeIds(from:"{appVendor}.{appName}@{oldMajor}.x", to:"{appVendor}.{appName}@{newMajor}.x")
    _10
    }

Replace only the values in curly brackets with those that apply to your scenario. Keep the x without replacing it with the minor and patch versions. If you do that, the mutation won't work.

  1. Run the code by clicking Execute Query (▶).

    The expected response body is:


    _10
    {
    _10
    "data": {
    _10
    "updateThemeIds": true
    _10
    }
    _10
    }

  2. In the VTEX Admin, go to the Storefront module and validate the content in its features, such as Site Editor, Pages, and Redirects.

  3. Once you have validated your data in the Storefront module, promote your workspace to master.

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page