Showing posts with label Sitecore Guide. Show all posts
Showing posts with label Sitecore Guide. Show all posts

Wednesday, 17 September 2025

Getting Started with Sitecore Content SDK for XM Cloud

September 17, 2025 0

 


Sitecore has announced the release of the Content SDK. The Content SDK helps developers integrate XM Cloud content with their front-end applications. It is set to replace the existing JSS SDK for XM Cloud. This new Content SDK will exclusively support XM Cloud, providing a cleaner and more streamlined solution.

In this blog, I’ll discuss the key features of the Content SDK, how to install it locally, and how to connect it with an XM Cloud instance for local development.


Key Features

  • Starter Template: Provides a ready-to-use Next.js template for fast project setup and seamless integration.

  • Framework-Specific Support: Leverages Next.js features like locale-based routing for multilingual sites, plus multiple rendering modes including SSR (server-side rendering) and SSG (static site generation).

  • GraphQL Utilities: Includes prebuilt queries to fetch content, layouts, site information, and dictionary data directly from Sitecore APIs.

  • Multi-Site Capabilities: Supports running and managing multiple independent websites from a single environment.

  • Personalization & Testing: Enables audience-based personalization and A/B/n component testing without custom code, making it simple to deliver tailored experiences and run experiments across visitor segments.

  • Analytics Integration: Offers built-in analytics and event tracking through the Sitecore Cloud SDK.

  • XM Cloud Pages Integration: Works seamlessly with XM Cloud Pages for visual authoring, component editing, and experience testing.

Prerequisites

  • Access to an XM Cloud instance.

  • Ensure you have the latest version of Node.js installed on your machine. It’s recommended to use the latest Long-Term Support (LTS) version.

  • A suitable IDE, such as Visual Studio Code.

Getting Started with Content SDK Installation

  1. Create a folder where you want to install the Content SDK.

    • For example: create a folder named Content SDK POC.

    • Open your terminal and execute the following command:
      npx @sitecore-content-sdk/create-sitecore-jss nextjs


  2. If prompted to install the create-sitecore-jss package, type Y to confirm.


  3. When asked, provide the folder path for your new app. You’ll also be asked to choose a rendering strategy between SSG (Static Site Generation) and SSR (Server-Side Rendering).


  4. Installed Successfully. 


Install Content SDK CLI

The Content SDK CLI provides various commands to work with Content SDK applications. By installing this tool globally, you can use these commands while developing any Content SDK applications on your local machine, such as when creating new components.

To install, run:

npm install -g @sitecore-content-sdk/cli



Once installed, the following folder structure will be generated on your file system.



Connecting to an XM Cloud Instance

To connect the app to the XM Cloud instance:

  1. Retrieve the required environment variables from the deployment portal.

  2. Create a .env.local file in the root folder of your newly created app.

  3. Add the environment variables into the .env.local file.


After setting up the environment variables, open a terminal, navigate to the Content SDK app’s folder, and run the following commands:

npm install

npm run start

Conclusion

The Sitecore Content SDK for XM Cloud offers a streamlined way to bring XM Cloud content into modern front-end applications. With its Next.js starter template, GraphQL utilities, CLI support, and seamless integration with XM Cloud Pages, it empowers developers to deliver scalable, personalized, and high-performing digital experiences. Whether using static generation or server-side rendering, the Content SDK provides a strong foundation to accelerate your headless Sitecore development journey.

References

Monday, 25 August 2025

Migrating from Sitecore XM to XM Cloud Using the Migration Tool GUI

August 25, 2025 0

 



Sitecore XM to XM Cloud Migration tool helps to move content, media and user data from a on-prem Sitecore Experience Manager (XM) instance to a target XM Cloud environment. It is middleware that simplifies the task of entering and selecting data, and orchestrating the migration. The tool is available in both a Graphical User Interface (GUI) tool, and a Command Line Interface (CLI) comprising operations that you can embed into your own tooling.

In my previous blog, I discussed about complete analysis a developer should perform before migrating from Sitecore XP/XM to XM Cloud. In our today's blog, I'll discuss about the Sitecore XM to XM Cloud Migration tool Graphical User Interface features and process.

The current version is v2.1.71. Current supported Sitecore XM versions are 9.1+ and 10.0+

Key Features

  • Dual support for GUI and CLI.

  • TreeView selection for choosing content and media items.

  • Media migration via CDN or on-premise MSSQL database binaries.

  • User migration directly into the Sitecore Cloud Portal.

Prerequisites

Before starting, ensure you have:

  • A Sitecore XM on-premise instance with content, media, or users.

  • A fresh XM Cloud environment.

  • Compatible OS: Windows Server 2022, Windows 10 (64-bit), or Windows 11 (64-bit).

What’s Inside the ZIP Package?

The migration tool’s ZIP file includes:

  • appsettings.json – configuration file.

  • Executable (.exe) to run the application.

  • SitecorePackage.zip – required for setup.

  • Logs folder.

  • README.md – highly recommended to read before starting.

  • Docs folder with details on configuration, dependencies, FAQs, and known issues.



Initial Setup

  1. Upload and install the SitecorePackage.zip file into your on-prem XM application.



  2. After installation, a new _MigrationHarness folder will appear in your XM root directory.


  3. Update the Web.config file to include specific <assemblyBinding> entries (for assemblies like protobuf-net, System.Buffers, System.Memory, etc.).

    <probing privatePath="_MigrationHarness/bin" />

              <dependentAssembly>

                <assemblyIdentity name="protobuf-net" publicKeyToken="257b51d87d2e4d67" />

                <codeBase version="2.4.0.0" href="_MigrationHarness/bin/protobuf-net.dll" />

              </dependentAssembly>

              <dependentAssembly>

                <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" />

                <codeBase version="6.0.0.0" href="_MigrationHarness/bin/Microsoft.Extensions.Logging.Abstractions.dll" />

              </dependentAssembly>

              <dependentAssembly>

                <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" />

                <codeBase version="4.0.2.0" href="_MigrationHarness/bin/System.Buffers.dll" />

              </dependentAssembly>

              <dependentAssembly>

                <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" />

                <codeBase version="4.0.1.2" href="_MigrationHarness/bin/System.Memory.dll" />

                <bindingRedirect oldVersion="4.0.1.1" newVersion="4.0.1.2" />

              </dependentAssembly>

              <dependentAssembly>

                <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" />

                <codeBase version="6.0.0.0" href="_MigrationHarness/bin/System.Runtime.CompilerServices.Unsafe.dll" />

                <bindingRedirect oldVersion="4.0.4.1" newVersion="6.0.0.0" />

              </dependentAssembly>


  4. Adjust the appsettings.json file if needed, especially the line:

    "SitecoreCmMigrationHandlerFileRelativePath": "_MigrationHarness/MigrationHandler.ashx"

Running the Migration GUI

  1. Launch XMMigrationGUI.exe and select the data types to migrate (Content, Media, and Users if required).


  2. Click on Next and you can see the Source configuration- Sitecore XM/XP on premises. 

    Please provide CM Base URL, Username and Password.



  3. Click on Next button and provide the XM Cloud settings. Please follow the instruction to find the specific data for each fields.




  4. You can get the XM Cloud Envionment related information from the enviornment (in our case Development) details section.



  5. If credentials are not already available, create new Cloud Portal credentials.


  6. Use the Content Tree view to select the items and Media you wish to migrate.


  7. Click on Next, and provide the credential to choose the users you want to migrate.


  8. Click the Next button and configure the Users Migration Target Settings. Click the Connect to Sitecore Cloud button and follow the instructions. A new browser window will be opened where you should log in as a Sitecore Portal User and confirm the code that you see in the Migration tool.


  9. As the last step for users configuration, choose an environment where you would like to invite users under the chosen organization.



  10. Review the migration summary and start the process.


  11. Once complete, your content, media, and users will be successfully migrated to your XM Cloud environment.

    On-Prem XM :



    XM Cloud



Conclusion

The Sitecore XM to XM Cloud Migration Tool (GUI) provides a guided approach for migrating data from on-premise to the cloud. By supporting both content and user migration, it eliminates much of the complexity involved in traditional migration methods. Whether you’re performing a quick lift-and-shift or preparing for a larger digital transformation, this tool ensures a smooth, reliable, and efficient migration experience.

References

1. XM Cloud Tools and Resources