Store Framework
Best practices
Migrating CMS settings after a major theme update
You may need to perform a major update of your Store Theme app due to changes in its peer dependencies. However, transitioning to a new major version of the Store Theme could potentially result in undesired consequences, such as losing the configured Admin page template settings.
To handle this situation and ensure a smooth migration, follow the steps below to migrate template settings.
Before you begin
- Install VTEX IO CLI.
- Install GraphQL IDE by running the following command:
vtex install vtex.admin-graphql-ide@3.x
.
Instructions
- Open the terminal and log in to your account.
- Change to the production workspace containing your latest changes and publish a new major version of your Store Theme app.
- Create a new production workspace by running the following command:
Replace the values in curly brackets with the values that apply to your scenario.
_10vtex use {workspaceName} --production
-
Install the Store Theme app published in the previous steps:
_10vtex install {appVendor}.{appName}@{appVersion} -
Open the VTEX Admin using the workspace created in Step 3 and go to the 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{_10 updateThemeIds(from:"{appvendor}.{appname}@{oldmajor}.x", to:"{appvendor}.{appname}@{newmajor}.x")_10}
- Replace the values in curly brackets with the values that apply to your scenario, and press Play.
- Open the VTEX Admin using the workspace created in the previous steps and validate the CMS content, routes, pages, and redirects.
- Once you have validated your data, promote your workspace to master.