- Home
- Migration Guide
- Tool Migration
- Perform Migration
- Migrate Projects
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.
Note
Choose the migration settings before you run the migration tool with --projects.
Changing them after you have migrated projects is not supported.
For details, see Settings to Choose Before Migrating Projects.
To migrate repositories as projects:
-
Run the migration tool with the
--projectsflag to prepare the MSR 2.9, MSR 2.10 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 --projectsThe 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 csvWithin 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 sqlThe migration recreates source organizations and repositories as projects.
- Verify the
-
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-rulesNote
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 been 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 the number of migration replication requests#
Optional. To reduce the load on the source system, administrators can limit the number of migration replication requests that MSR 4 sends to MSR 2.9 or MSR 2.10.
To reconfigure maxJobWorkers and limit how many tags are being concurrently
migrated by MSR 4:
-
Set MSR 4 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.
Restart the Migration with Different Settings#
To use different values for the settings listed in Settings to Choose Before Migrating Projects, start the migration again:
-
Stop the migration replication:
- Remove the trigger of the migration rules with
--remove-replication-rules-trigger. - Wait until no replication that uses the migration rule prefix is running in Administration > Replications, or stop the running replications.
- Delete the rules with
--delete-migration-rules.
For details, see Post-Migration Cleanup.
- Remove the trigger of the migration rules with
-
Deploy a new MSR 4 instance. Mirantis recommends this option.
Alternatively, remove everything that the migration tool created from the current MSR 4 instance:
- Projects, with their repositories and tag immutability rules
- Groups and members
- Push and pull mirroring rules, using
--delete-push-replication-rulesand--delete-pull-replication-rules - The registry endpoint of the source MSR in Administration > Registries
Caution
MSR 4 deletes a project only after you delete its repositories, so this cleanup takes a long time if images are already migrated.
-
In
config/config.env, set the new values and setREUSE_ALREADY_FETCHED_DATA=false. With this setting, the migration tool fetches the source data again instead of reusing the data from the earlier run. -
Empty the
CSV_DATA_DIRdirectory. The migration tool keeps the LDAP group state from the earlier run (ldap_group_state.json) in this directory and loads it again. -
Run the migration again from the start.