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:
-
Install the VTEX IO CLI.
-
Install GraphQL IDE by running the following command:
_10vtex install vtex.admin-graphql-ide@3.x
Instructions
-
Open the terminal and log in to your account.
-
Switch to the production workspace with your latest changes, and publish a new major version of your Store Theme app.
-
In the production workspace, install the Store Theme version published in the previous steps by running the following command:
_10vtex install {appVendor}.{appName}@{appVersion} -
Open the VTEX Admin of the production workspace used in the previous steps and go to GraphQL Admin IDE:
_10vtex browse admin/graphql-ide -
From the Choose an app dropdown list, select
vtex.pages-graphql@2.x
. -
Copy the code below and paste it into the GraphQL IDE.
_10mutation{_10updateThemeIds(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.
-
Run the code by clicking
Execute Query
(▶).The expected response body is:
_10{_10"data": {_10"updateThemeIds": true_10}_10} -
In the VTEX Admin, go to the Storefront module and validate the content in its features, such as Site Editor, Pages, and Redirects.
-
Once you have validated your data in the Storefront module, promote your workspace to master.