This project tries to migrate several data types between two Azure DevOps projects. The script extends the destination project so you can have existing definitions. ID mapping uses names therefore you may need to rename your resources temporarily.
Supported resources:
- Service endpoints
- Variable groups
- Task groups
- Git repositories
- Build definition folders
- Build definitions
- Release definitions
- Install Docker
- Install VSCode
- Install Remote - Containers VSCode extension
- Must exists
- Hard-code a PAT with write scopes (see main.py)
You need to install all third-party extensions first. Note that the fresh install of an extension doesn't install the previous versions. Therefore you need to update your steps in the builds of the source project to match with the extension version of the destination project. Otherwise the build creation will fail due the missing task version.
(Task version in the classic build editor can be found in the upper dropdown on the task edit area.)
Dependencies between builds are not implemented which means you have to turn off build completion triggers in the build source otherwise migration will fail. Reenable it manually.
This script unable to migrate endpoints which can't be fully queried. If you see errors during service endpoint creation then go and create the failed endpoints with the proper type manually and give them the same name as original.
- You have to change default and compare branches if they aren't the defaults.
- Also you have to setup branch policies if any.
There is no API to manage secure files, you have to create them manually and hard-code their IDs in the script. Call them whatever you want.
You can get the IDs from the url (secureFileId) during edit. https://dev.azure.com/example/MyProject/_library?itemType=SecureFiles&view=SecureFileView&secureFileId=3a41393c-d8f9-4013-bb2b-02f3b9b2d17a&path=fb_key_for_unit_tests.json
- Open the project root in VSCode
- Build the dev container
- Edit
main.py
- Run
- Don't rush, migrate one resource type at a time.
- Always check the result.
- Use read-only PAT for the source project, just in case
- Builds are modified to run in
Default
agent pool - Agent pool information is deleted for release jobs