Migrating Content and Users with the XM to XM Cloud Migration Tool CLI


In my previous blog, I discussed how we can migrate content, media, and users using the XM to XM Cloud Migration Tool – GUI option.

In today’s blog, I’ll walk you through the CLI (Command Line Interface) option, which provides the same functionality but is also ideal for scripting and automation.

Step 1: Configuration Setup

It is very important to use the same configuration settings as in the GUI version, stored in the appsettings.json file.
If needed, you can adjust some values manually. You can also refer to a sample appsettings.json file here.

Key Configurations

RAIFs Configuration

The XM to XM Cloud Migration Tool transfers content and media via RAIFs (batches).

  • The default values in appsettings.json are balanced for most customers.

  • ItemsPerRaif defines the number of items per transfer.

    • Too low → creates too many RAIF files.

    • Too high → may impact transfer speed.

  • MediaSizeLimit defines the maximum media size per RAIF.

    • Must be a long value.


Content Migration Configuration

Ensure proper settings for source and target configuration before executing migration.


Step 2: Explore CLI Options

Navigate to the folder containing the console app and run:

.\XMMigration.exe --help

This will display a list of all available commands.


Step 3: Migrate Content

Run the following command to migrate content:

.\XMMigration.exe content



Step 4: Migrate Users

You have multiple options for migrating users:

  • Retrieve domains from the source instance

    .\XMMigration.exe users --retrieve-domains

  • Migrate users by passing domains (comma separated)

    .\XMMigration.exe users --migrate-userdomains sitecore


This may ask to login to XM Cloud-


Key Points to Remember

  1. This tool can only be used for “as-is” migration.

    • Content cannot be transformed.

    • Content templates cannot be updated.

  2. Templates must be migrated first, followed by content.

  3. Only media items stored in the database can be migrated.

  4. Best suited for migrating a large volume of legacy content to XM Cloud.

Conclusion

The XM to XM Cloud Migration Tool’s CLI option is powerful for automation and large-scale migrations. With proper configuration and sequence, it ensures a smooth transfer of content, media, and users to XM Cloud.

Comments

Popular posts from this blog

Setup New Project in Sitecore XMCloud – Part 1

Step by Step installation of Sitecore 10.3 on Azure PaaS

Step by Step installation of Sitecore 10.3 on Docker