Walkthrough: Migrating to the modular repository structure

Abstract

Update the repository structure of your Managed Cloud solution.

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

To prepare the migrate:

1. Go to the mccsharedupgradestorage 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.

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 topic. If you added monitoring extensions, read the Add a custom Prometheus alert topic and the Import and export your Grafana dashboard topic.

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 folders that were brought by 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 for details.

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 for details.

• 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.