Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 2.93 KB

vtex-io-documentation-migrating-cms-settings-after-major-update.md

File metadata and controls

67 lines (47 loc) · 2.93 KB
title slug hidden createdAt updatedAt
Migrating CMS settings after a major theme update
vtex-io-documentation-migrating-cms-settings-after-major-update
false
2020-09-22T20:44:01.218Z
2024-12-02T21:07:29.844Z

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.

❗These 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:

    vtex install [email protected]

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:

    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:

    vtex browse admin/graphql-ide
  5. From the Choose an app dropdown list, select [email protected].

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

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

❗ 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:

    {
      "data": {
        "updateThemeIds": true
      }
    }
  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.