Migrate Projects¶
During migration, source organizations and repositories are recreated as projects. You can configure replication behavior both during and after migration using the options provided by the migration tool.
To migrate repositories as projects:
Run the migration tool with the
--projectsflag to prepare the MSR 2.9 or 3.1 repositories for migration:docker run --rm \ -v ./sql:/app/data/sql \ -v ./csv:/app/data/csv \ -v ./config:/app/config \ --network host \ registry.mirantis.com/msrh/migrate:latest poetry run migration --projects
The migration tool first exports data from MSR and Enzi. It then processes this data to import all repositories into MSR 4. Exported data is stored in the
csvdirectory, while data prepared for import resides in thesqldirectory.Optional. Verify if data has been exported:
Verify the
./csvdirectory for exported data:ls -l csv
Within the
csvdirectory, all exported files are prefixed with eithermsr_orenzi_, indicating their source. Files prefixed withharbor_represent data migrated to MSR 4, exported for verification purposes.Verify the
./sqldirectory for SQL files that contain data to be imported into MSR 4:ls -l sql
The migration recreates source organizations and repositories as projects.
Open the MSR web UI and verify if the projects are visible.
Export data and migrate projects¶
To run the migration replication process with Cron-Based trigger:
Configure the replication schedule in the
config/config.envfile:REUSE_ALREADY_FETCHED_DATA=True REPLICATION_TRIGGER_CRON="0 0 1 * * *"
See the Configuration Reference for complete configuration reference.
Start an interactive partial migration:
docker run --rm \ -v ./data/sql:/app/data/sql \ -v ./data/csv:/app/data/csv \ -v ./config:/app/config \ --network host \ registry.mirantis.com/msrh/migrate:latest poetry run migration \ --trigger-replication-rules
Note
The migration process may take a significant amount of time, depending on factors such as storage and network speed, and the volume of data in your project.
To trigger the migration replication process manually:
In the MSR 4 web UI, navigate to Replication rules page and check how many pages of
migration-rulereplication rules have been created.Set the
PAGEparameter in the command to match the number of pages.Note
The
PAGE_SIZEparameter corresponds to the page size setting in the MSR 4 web UI. For example, if the page size is set to15, use--PAGE_SIZE=15.docker run \ -v ./sql:/app/data/sql \ -v ./csv:/app/data/csv \ -v ./config:/app/config \ --network host \ registry.mirantis.com/msrh/migrate:latest \ utils/run-migration-replication-rules.sh --PAGE=1 --PAGE_SIZE=<NUMBER-OF-PAGES>
Verify the migration replication status¶
To verify that all replication tasks have completed, run the following command with your environment-specific values:
docker run registry.mirantis.com/msrh/migrate:latest utils/migration_replication_status.sh \
--url=msr4.[MY-DOMAIN].com \
--user=admin \
--pwd=[ADMIN-PASSWORD]
Example output:
Fetching policies with prefix 'migration-rule-'...
=== Replication Summary ===
Total executions: 191
Succeeded : 188 (98.4%)
In Progress : 0 ( 0.0%)
Failed : 3 ( 1.6%)
Stopped : 0 ( 0.0%)
Others : 0 ( 0.0%)
Note
To view command options and usage instructions, run:
docker run registry.mirantis.com/msrh/migrate:latest utils/migration_replication_status.sh --help
Limit number of migration replication requests¶
Optional. To reduce the load on the source system, administrators can limit the amount of migration replication requests that MSR 4 sends to MSR 2.9.
To reconfigure maxJobWorkers and limit how many tags are being concurrently
migrated by MSR 4:
Set MSR4 to Read-Only Mode:
Log in to MSR 4 as an administrator.
Navigate to Administration > Configuration.
Under System Settings, enable the Repository Read-Only option.
Click Save to apply the changes.
In the
msr-values.yamlfile, change themaxJobWorkersparameter from10to4.Apply the Helm chart.
Disable read-only mode:
Log in to MSR 4 as an administrator.
Navigate to Administration > Configuration.
Under System Settings, disable the Repository Read-Only option.
Click Save to apply the changes.