Migrate your existing repositories to Mend for Bitbucket Data Center global configuration
Overview
When you set up a global configuration for Mend for Bitbucket Data Center, you may have repositories that are already onboarded with the integration that you want to include in the global setup.
This article provides information on how to migrate existing integrated repositories into your global configuration for Mend for Bitbucket Data Center.
Use Case
Configuration of the migration occurs via a migration.json file within your whitesource-config repository. To set up your migration, see the Parameters section provided in this documentation. Below are a couple of examples of fine-tuning a migration using a migration.json file:
Example One: A migration.json using the includeRepos setting:
{
"migrationMode": {
"changeType": "inheritance",
"openPR": true
},
"includeRepos": ["bitbucket/repo1","bitbucket/repo2"]
}
Example Two: A migration.json using the excludeRepos setting:
{
"migrationMode": {
"changeType": "inheritance",
"openPR": true
},
"excludeRepos": ["bitbucket/repo3","bitbucket/repo4"]
}
Getting It Done
Performing a migration may slow down the overall responsiveness of the integration. The migration may take a few hours to complete. When performing a migration on more than 500 repositories, the migration Check Run indicating the status of the migration may not be created due to a Bitbucket Data Center content size limitation.
Prerequisites
Ensure you have performed the steps described in setting up the global configuration.
You must have administrator permissions to your Bitbucket Data Center account and to the relevant repositories (owner credentials).
Start the migration
If you have existing repositories that you want to inherit from the global configuration, do as follows:
Go to the whitesource-config repository.
Add a migration.json file that includes its parameters to the whitesource-config repository’s default branch.
Commit and push the migration.json file to start the migration.
View the migration status
A Mend Security Check will be generated and display a summary of the migrated repositories.
View the migration results
A Mend Security Check will be generated and display a summary of the migrated repositories. In addition, the migration.json file will be deleted after the migration is completed.
Reference
Parameters
migration.json - General Parameters
Parameter | Type | Description |
---|---|---|
includeRepos | Array | Optional. Default Value: N/A. Provide a list of specific full repository names (owner/repo_name) on which the migration should run. Example:
CODE
Note: You cannot use includeRepos together with excludeRepos as part of a migration. |
excludeRepos | Array | Optional. Default Value: N/A. Provide a list of specific full repository names (owner/repo_name) on which the migration should not run. Example:
CODE
Note: You cannot use excludeRepos together with includeRepos as part of a migration. |
migration.json - Migration Mode (migrationMode
)
Parameter | Type | Description |
---|---|---|
changeType | String | Optional. Default Value: There are three possible values:
Note:
Note: |
openPR | Boolean | Optional. Default Value: NOTE: When set to false, every migrating repository that currently contains a .whitesource file will trigger an automatic scan after these are migrated. This may affect overall performance of the integration depending on how many migrating repositories you have. |
triggerScan | Boolean | Optional. Default Value: Note: this parameter is relevant only when using migrationMode.changeType: “ |