The article in a nutshell, for migrating contents to XMC, it can be packaged or Sitecore CLI XMCloud Plugin can be used for all our content related requirements i.e., serializing contents, port content from one XMC instance to another -> between developers and between environments. The new XM Cloud Plugin comes with cloud commands that help us achieve this.
When I first got to know about XMC I was really curious to know how the data/content gonna be structured? Will it be structured like Content Hub? The look and feel…the data…the schema and the way we create an entity….would it resemble Content Hub? Or would it be similar to what we have in XM/XP. Not sure if this is because I am more used to the items/templates/content tree type of thing, I have always felt this architecture as a bit clean and less complicated…no non sense way to handle content.
Because if there are slight difference in this area, then migrating contents from traditional Sitecore XM/XP would be difficult while migrating to XM Cloud. Difficult in the sense would require new tools and developers need to understand the new data architecture/process etc.
Although when I came to know that XMC comes with the same core/master/web/(horizon) db I should have connected the dots. But somehow I was blank until I actually saw XMC. May be because all the initial blogs/webinars I have seen showed/talked mostly about Sitecore cloud portal/XM Cloud Pages/XM Cloud Deploy and the new XMC Launchpad.
Alright coming to the point, XM Cloud also uses the same traditional Sitecore content editor.

All this preface about contents is to take a lead on how the content can be migrated from traditional XM/XP and about the new Sitecore.DevEx.Extensibility.XMCloud plugin.
Sitecore.DevEx.Extensibility.XMCloud Plugin:
Sitecore CLI from it’s initial release has released new plugins every now and then. (Serialization, Publishing, Indexing etc). One new addition to it is XMCloud plugin.
While setting up XMC locally, the up.ps1 itself installs the necessary plugins esp. XMCloud.


In fact this is how you will be redirected to XM Cloud Portal for authentication during the local setup process.
XM Cloud Remote Instance – Local – Cloud Plugin Operations:
- When you setup XMC Locally, the up.ps1 doesn’t automatically sync up the contents from the remote to your local.
- This has some logic, because an Organization can have multiple XMC projects and each project can have multiple environments. So the default up.ps1 doesn’t handle which project which environment should be mapped to your local XM Cloud instance.
- However, the first time we have to connect the local instance to cloud and then map/configure the serialization contents and finally once all these are setup and the serialized contents are available in the repositories, using the cloud plugin commands we can customize the up.ps1 script so that while setting up local itself we can bring in the contents as we spin up.
- Remaining stuffs are similar to that of traditional XM/XP. Instead of connecting via Sitecore Identity Server, we will be logging in to the XMC Portal via cloud login command which in turn authenticates via auth.sitecorecloud.io. We have the same module.json in our solution where we create the serialization configurations in XMC as that of traditional XM/XP. We have the same interactive/non-interactive client login. Same serialization push/pull.
- Deployment: Sitecore CLI Cloud deployment command can be used for creating XM Cloud Deployments via Sitecore CLI. By default, XMC provides an option to do automated deployment every time when a commit is made to a particular branch – say main/master. Beyond that whenever your solutions needs to be uploaded and a deployment to particular environment is required, it can be done via Cloud Plugin Deployment command. This has sub commands that helps setup this.
dotnet sitecore cloud deployment create/start/info -deploymentID
- Projects and Environments: When you first create a XMC project in cloud, you would given it a name and created at least one environment. These projects and environment details are required to pull the contents from portal and also push the local new serialization items to the portal.
dotnet sitecore cloud project list

dotnet sitecore cloud environment list --project-id 3yrb92gxtVo4GhtBllr5gh

Connect your local to the target environment:
dotnet sitecore cloud environment connect -id 1h1eqtyv0ZOVltfzYnBi3g --allow-write true
dotnet sitecore connect --ref xmcloudlocal --cm https://xmcloudcm.localhost --allow-write true -n "environmentname"


dotnet sitecore ser pull -n "Environment to be pulled from"

dotnet sitecore ser push -n "Environment the serialized files to the pushed to"

With the commands I mentioned above we can create a custom synclocalwithremoteenvironment.ps1 where we can pass the source and target environments and sync contents as an when needed, instead of running these commands every time.
And to conclude on the ContentHub vs traditional Sitecore XM/XP – a small comparison comment I made in the beginning, I would say XMC has the cool new features similar to the latest Sitecore SaaS products while retaining the robust, simple and clean traditional sitecore XM/XP components and modules.
One thought on “Sitecore – XM Cloud – CLI – Sitecore.DevEx.Extensibility.XMCloud Plugin”