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:

  1. Run the migration tool with the --projects flag to prepare the MSR 2.9 or 3.1 repositories for migration:

    docker run \
      -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 csv directory, while data prepared for import resides in the sql directory.

  2. Optional. Verify if data has been exported:

    • Verify the ./csv directory for exported data:

      ls -l csv
      

      Within the csv directory, all exported files are prefixed with either msr_ or enzi_, indicating their source. Files prefixed with harbor_ represent data migrated to MSR 4, exported for verification purposes.

    • Verify the ./sql directory for SQL files that contain data to be imported into MSR 4:

      ls -l sql
      

    The migration recreates source organizations and repositories as projects.

  3. Open the MSR web UI and verify if the projects are visible.

Export data and migrate projects

To trigger the replication process:

  1. Configure the replication schedule in the config/config.env file:

    REUSE_ALREADY_FETCHED_DATA=True
    REPLICATION_TRIGGER_CRON="0 0 1 * * *"
    

    See the Configuration Reference for complete configuration reference.

  2. Start an interactive partial migration:

    docker run \
      -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-rule
    

    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.

  3. 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