Validate Migration Data

This section outlines optional steps you can take to ensure that the data was imported successfully. These steps verify the artifacts generated by the migration tool, help confirm that the tool produced the expected outputs, and applied the correct translations and naming conventions.

Core validation procedures are already built into the migration workflow. To ensure all required checks are completed, follow the validation steps provided in every step of the migration guide.

Projects

To verify that all repositories have been migrated:

  1. Truncate and sort the data on both versions of MSR:

  2. Count how many namespace and repository name entries exist in the original MSR data:

    cat msr_repo | wc -l
    
  3. Repeat the process for MSR 4 data:

    cat harbor_repo | wc -l
    
  4. Compare the results. The MSR 4 output should have exactly one more entry. This extra entry comes from the default library repository included with the MSR 4 instance.

  5. To verify the migration, remove the library project from the MSR 4 results.

  6. Use vimdiff or a similar tool to compare the files and confirm that repository names match between MSR versions.

    Note

    vimdiff is not included in the container and must be installed separately if used.

Groups

To verify that all groups have been migrated:

  1. Filter original MSR Enzi group data by removing any rows where the groupDN field is empty:

    docker run \
        -v ./sql:/app/data/sql \
        -v ./csv:/app/data/csv \
        -v ./config:/app/config \
        --network host \
        registry.mirantis.com/msrh/migrate:latest \
        mlr --csv filter '!is_empty($groupDN)' /app/data/csv/enzi_teams.csv
    

    Note

    Groups with empty groupDN values are skipped during migration and not imported into MSR 4.

  2. Count how many valid groups remain after filtering:

    docker run \
        -v ./sql:/app/data/sql \
        -v ./csv:/app/data/csv \
        -v ./config:/app/config \
        --network host \
        registry.mirantis.com/msrh/migrate:latest \
        mlr --csv filter '!is_empty($groupDN)' /app/data/csv/enzi_teams.csv | wc -l
    
  3. Determine how many groups are currently present in MSR 4 using the exported PostgreSQL data:

    docker run \
     -v ./sql:/app/data/sql \
     -v ./csv:/app/data/csv \
     -v ./config:/app/config \
     --network host \
     registry.mirantis.com/msrh/migrate:latest \
     mlr --csv sort -f name data/csv/harbor_groups.csv | wc -l
    
  4. Compare the group counts from both steps.

  5. Extract and sort group names from the input Enzi set, saving the output to a file named msr_groups:

    cat ./csv/msr_repositories_with_enzi_team.csv | cut -d, -f1,9,12 | awk -F',' '$3 != ""' | cut -d, -f1,2 | sort -u >
    
  6. Repeat the process for MSR 4 groups:

    cat ./csv/harbor_groups.csv | cut -d, -f2 | sort -u > msr4_groups
    
  7. Compare the contents of msr_groups and msr4_groups. Verify whether group names have been correctly prefixed by their namespaces. Use tools such as delta or mlr for a side-by-side comparison. These tools are available both locally and within the migration tool container.