Sitecore 10.4 XM on-premise instance to XM Cloud Content migration tool test-drive

As I had setup a local Sitecore 10.4.0 instance, I wanted to try the Content migration tool available for quite sometime (probably from 10.1). This is a simplistic tool that uses Sitecore Content Serialization, released as part of 10.0 version, as the core concept. Note that the tool must run in the machine that hosts the on-premise Sitecore instance. Probably, this is also the reason that the tool doesn't support a source hosted in Azure PaaS or any other PaaS as of now.

Content Migration tool process overview:

My goal was to setup a few content folders/items in my local instance and push it to the XM Cloud environment. So, without much ado - Two options available in the content migration tool


1. GUI-based option: Unzip the downloaded zip file and launch the XMMigrationGUI.exe

Welcome screen:

Note that the tool is expected to migrate not only content but also users as well as domains.

The tip beneath the fields are self-explanatory and source points to my local instance:

Destination XM Cloud instance:

Content tree from source is loaded:


Note that the GUI could become unresponsive if you try to load a tree node with 1000s of items since the loading happens synchronously.

Once you click the next button, you should see the changes reflected in the associated appSettings.json:

If you are curious and try rules here, it might not work since the actual module.json files are stored within the step 4 and 5 folders (details below).

On clicking the next button, you see the migrate button and you can see the logging in action on clicking the same:


High-level overview of the migration:

==========================================================================

Step 1: Get Migration Dependencies for Sitecore CM Instance

Download Sitecore Management Services module (SMS)

==========================================================================

Step 2: Install Migration Dependencies (SMS) On Sitecore CM Instance

==========================================================================

Step 3: Setup Sitecore CLI

==========================================================================

Step 3.1: Setup non-interactive client login for CLI (source instance)

==========================================================================

Step 4: Migrate from XM Legacy using Sitecore Content Serialization (SCS)

Pull from Source

==========================================================================

Step 5: Migrate to XM Cloud using Sitecore Content Serialization (SCS)

Push to XMC Destination

==========================================================================

There are folders created in the file system for each step for reference under the temp folder:


For instance, serialized items before push to XMC destination for reference in the step-5 folder:

The following diagram is based on folder artifacts:

I then bulk loaded items in source instance with this SPE script:

##########

##########

Bulk load time to XMC:

Item Count

Seconds

10

1.5

1000

149

10000

1669

2. CLI-based option: If you download the cli zip, then you have an XMMigration.exe and with the command line, you can check the available options:

 .\xmmigration.exe --help


The migrate-content cmdlet does the same job as the migrate button click in the GUI and all that it needs is the appSettings.json (same structure as the one with the GUI tool) with tree nodes for serialization.

Usage: 

 .\xmmigration.exe --migrate-content

The migration section has the (source and destination) environment details as follows:


There is a content and user section too and they store the content/user to be serialized. Based on the cmdlets you can see that you can migrate domains and users between environments.

For migrating users, select users in the welcome screen of the GUI:


In the following screen, you get a list of custom domains on clicking the connect button:


On clicking next button, you can migrate the domain users to XMC:


Clicking the migrate button asks you to connect to the XMC environment and subsequently an invite is sent to the email address registered while creating the user in the source instance:


Now, back in the appSettings.json, the org id is added automatically along-with the domain name to be migrated:


There must be an XMC email invitation to the concerned email address:


Back in the command prompt, retrieve domains cmdlet should work fine:

.\xmmigration.exe --retrieve-domains


Note that you could use the migrate-userdomains cmdlet to migrate users through cmd prompt similar to the flow with GUI.

.\xmmigration.exe --migrate-userdomains test


Need for Clear/reset button:
1. Create a folder in the source instance, add a sample item and migrate
2. Back in the source instance, delete the concerned source folder 
3. In the tool, the concerned source folder is still retained in the list box

4. Now, even if you add a valid item from the source tree and try to migrate, it won't be serialized/migrated unless the ModuleItems section in appSettings.json is corrected - by physically removing the deleted item json:

5. Good to have a clear or reset button in the window so that items can be cleared or reset to a valid item in appSettings.json and this reflects in the bottom list box too so that new/valid items can be added as per user's wish

At this point, the content migration tool could be a good one to migrate tree nodes from on-premise environments to XMC environments although it doesn't currently have the ability to track content changed in a time range to migrate just the delta. Also, razl package connections could be a good add-on to support a PaaS source instance. One thing I really liked is the way it installs the prerequisites like the SMS module in the source instance and sets up the CLI for migration. 

Comments

Popular Posts