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
Prepare the migration
To prepare the migrate:
-
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
NoteIf you cannot access the storage account, open a service request for DevOps Engineer access.
-
Download and unzip the package to a temporary folder.
-
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.
-
Migrate the infrastructure
To migrate the infrastructure:
If you have customized files, you must make sure that all custom changes are separated into different modules.
-
Create a feature branch and copy all the contents of the
Infrastructure
folder to the Infrastructure repository except for the following folder:-
config\resources
-
-
If you have a
version.txt
file, delete it. -
Remove all the folders under the root folder, except the
frontdoor
folder and the folders that are present in the MCC upgrade package. -
Compare the
config\resources\resources.json
file and thesku\resources.{topology-size}.json
file. Updateconfig\resources\resources.json
if there are any differences in the structure. -
Create a pull request against the main branch. Review and resolve any conflicts.
-
Complete the pull request. The
infrastructure
pipeline runs and applies changes automatically. -
Check that the
infrastructure
pipeline run finishes successfully. -
Run the
frontdoor
pipeline if there were any changes. -
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.
Migrate the application
To migrate the application:
If you have customized files, you must make sure that all custom changes are separated into different modules.
-
Create a feature branch and copy all the contents of the
Application
folder to the Application repository except for the following folder:-
config\resources
-
-
If you have a version.txt file, delete it.
-
Compare the
config\resources\resources.json
file and thesku\resources.{topology-size}.json
file. Updateconfig\resources\resources.json
if there are any differences in the structure. -
Remove all the folders under the
roles
folder that was committed by Sitecore, except folders that came with the MCC upgrade package. -
Create a pull request against the main branch. Review and resolve any conflicts. The
application
pipeline runs and applies changes automatically. -
Check that the
application
pipeline run finishes successfully. -
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 changes
To revert the changes and return to the original state:
-
Revert the pull request for the Infrastructure repository and run the
Infrastructure
andFrontdoor
pipelines to apply the changes. -
Revert the pull request for the Application repository and run the
Application
pipeline to apply the changes.