---
title: "Walkthrough: Migrating to the modular repository structure"
slug: "walkthrough--migrating-to-the-modular-repository-structure"
abstract: "Update the repository structure of your Managed Cloud solution."
---
# Walkthrough: Migrating to the modular repository structure

The Managed Cloud Containers solution now supports a modular repository structure. This structure lets you move non-customer-related code to the outside storage and makes it easier to upgrade your solution in the future.

To check if your solution already supports the modular structure, in the Application repository, look for the `solution.json` file. If the repository does not contain the `solution.json` file, and you want to migrate to the modular structure, follow the procedures in this topic.

This walkthrough describes how to:

- Prepare the migration
- Migrate the infrastructure
- Migrate the application
- Revert the changes

<details>
<summary><h2>Prepare the migration</h2></summary>

To prepare the migrate:

1. Go to the [mccsharedupgradestorage](https://portal.azure.com/#blade/Microsoft_Azure_Storage/ContainerMenuBlade/overview/storageAccountId/%2Fsubscriptions%2F06841065-b1ff-4f84-bf1c-f13d07c59810%2FresourceGroups%2Fmcc-shared-upgrade-storage-rg%2Fproviders%2FMicrosoft.Storage%2FstorageAccounts%2Fmccsharedupgradestorage/path/mcc-upgrades/etag/%220x8D9468AF8C2CD36%22/defaultEncryptionScope/%24account-encryption-key/denyEncryptionScopeOverride//defaultId//publicAccessVal/None) storage account, open the mcc-upgrades container, and find the latest revision for your topology and Sitecore version: `- mcc.{topology}.upgrade.{sitecore_version}-r.{revision}.nupkg`

    > [!note]
    > If you cannot access the storage account, open a service request for DevOps Engineer access.

2. Download and unzip the package to a temporary folder.
3. Review your repositories and look for the customizations you have made:
    - For customized files in the Infrastructure repository: move the custom files to separate terraform modules.
    - For customized files in the Application repository: move the custom files to separate Ansible roles. For example, if you added additional public services, follow the process described in the [Add a public service](https://doc.sitecore.com/xp/en/developers/101/managed-cloud/add-a-public-service.html "Add a public service") topic. If you added monitoring extensions, read the [Add a custom Prometheus](https://doc.sitecore.com/xp/en/developers/101/managed-cloud/add-a-custom-prometheus-alert.html "Add a custom Prometheus alert") alert topic and the [Import and export your Grafana dashboard](https://doc.sitecore.com/xp/en/developers/101/managed-cloud/import-and-export-your-grafana-dashboards.html "Import and export your Grafana dashboards") topic.

</details>

<details>
<summary><h2>Migrate the infrastructure</h2></summary>

To migrate the infrastructure:

> [!note]
> If you have customized files, you must make sure that all custom changes are separated into different modules.

1. Create a feature branch and copy all the contents of the `Infrastructure` folder to the Infrastructure repository except for the following folder:
    - `config\resources`
2. If you have a `version.txt` file, delete it.
3. Remove all the folders under the root folder, except the `frontdoor` folder and the folders that are present in the MCC upgrade package.
4. Compare the `config\resources\resources.json` file and the `sku\resources.{topology-size}.json` file. Update `config\resources\resources.json` if there are any differences in the structure.
5. Create a pull request against the main branch. Review and resolve any conflicts.
6. Complete the pull request. The `infrastructure` pipeline runs and applies changes automatically.
7. Check that the `infrastructure` pipeline run finishes successfully.
8. Run the `frontdoor` pipeline if there were any changes.
9. If you have added new files to the pipelines folder, you must create a new pipeline in Azure DevOps and link it to the new pipeline (**yaml** file from the pipelines folder). See the [pipelines documentation](https://doc.sitecore.com/xp/en/developers/101/managed-cloud/the-managed-cloud-standard-pipelines.html "The Managed Cloud Standard pipelines") for details.

</details>

<details>
<summary><h2>Migrate the application</h2></summary>

To migrate the application:

> [!note]
> If you have customized files, you must make sure that all custom changes are separated into different modules.

1. Create a feature branch and copy all the contents of the `Application` folder to the Application repository except for the following folder:
    - `config\resources`
2. If you have a **version.txt** file, delete it.
3. Compare the `config\resources\resources.json` file and the `sku\resources.{topology-size}.json` file. Update `config\resources\resources.json` if there are any differences in the structure.
4. Remove all the folders under the `roles` folder that was committed by Sitecore, except folders that came with the MCC upgrade package.
5. Create a pull request against the main branch. Review and resolve any conflicts. The `application` pipeline runs and applies changes automatically.
6. Check that the `application` pipeline run finishes successfully.
7. If you have added new files to the pipelines folder, you must create a new pipeline in Azure DevOps and link it to the new pipeline (**yaml** file from the pipelines folder). See the [pipelines documentation](https://doc.sitecore.com/xp/en/developers/101/managed-cloud/the-managed-cloud-standard-pipelines.html "The Managed Cloud Standard pipelines") for details.

</details>

<details>
<summary><h2>Revert the changes</h2></summary>

To revert the changes and return to the original state:

- Revert the pull request for the Infrastructure repository and run the `Infrastructure` and `Frontdoor` pipelines to apply the changes.
- Revert the pull request for the Application repository and run the `Application` pipeline to apply the changes.

</details>