Documentation
Feedback
Guides
Storefront Development

Storefront Development
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

  1. Install VTEX IO CLI.
  2. Install GraphQL IDE by running the following command: vtex install vtex.admin-graphql-ide@3.x.

Instructions

  1. Open the terminal and log in to your account.
  2. Change to the production workspace containing your latest changes and publish a new major version of your Store Theme app.
  3. Create a new production workspace by running the following command:

Replace the values in curly brackets with the values that apply to your scenario.


_10
vtex use {workspaceName} --production

  1. Install the Store Theme app published in the previous steps:


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

  2. Open the VTEX Admin using the workspace created in Step 3 and go to the GraphQL Admin IDE:


_10
vtex browse admin/graphql-ide

  1. From the Choose an app dropdown list, select vtex.pages-graphql@2.x.
  2. 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
}

  1. Replace the values in curly brackets with the values that apply to your scenario, and press Play.
  2. Open the VTEX Admin using the workspace created in the previous steps and validate the CMS content, routes, pages, and redirects.
  3. Once you have validated your data, promote your workspace to master.
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
On this page