This repository contains configuration files and scripts to migrate data from ALM Quality Center (ALM QC) to TestRail. The migration occurs at the database level, migrating the data from the ALM QC database into the TestRail database. The migration ELT (Extract-LoadTransform) process uses Docker containers with Airbyte and data transformation scripts, to move data from ALM QC to TestRail.
The migration copies one specified ALM QC project database from an on-premise ALM QC server to one project in an on-premise TestRail Server. Further projects can be migrated from ALM QC to TestRail if needed, and a subsequent migration from TestRail Server to TestRail Cloud can also be performed if needed.
Migration requirements & pre-requisites
The TestRail instance that is the target of the data migration must use MySQL 8.x, not 5.x as the database.
- The TestRail Server instance that is the target of the migration must be already setup and running.
- macOS or Linux are recommended for the computer running the migration. The migration automation bash scripts in this repository configure and execute the Docker-based migration tooling, and require a Unix-like operating system that is capable of running bash scripts. (Tip: Windows PowerShell with Windows Subsystem for Linux (WSL) should suffice, if it is the only option, but it has not been tested.)
- Install Docker and docker-compose (which is included with Docker Desktop) on the computer running the migration.
-
Allocate at least 16 gigabytes (GB) of RAM for running the Docker containers. The Docker default is 50% of the computer's RAM, so the default is sufficient on a computer with 32GB+ of RAM. You can adjust the amount of memory allocated to Docker from the Docker Desktop settings.
The ALM QC instance that is the source of the data migration must use SQL Server, not Oracle, as the database.
- Verify that the computer running the migration has access to the MS SQL Server database of the ALM QC instance that is the source of the migration. You will need:
- the ALM QC database host
- the Microsoft SQL Server port (e.g.
1433) - the name of the ALM QC database containing all user and project data (e.g.
sa) - the name of the ALM QC project database(s) to be migrated, which take the form of
<domain_name>_<project_name>(e.g.<demo_domain_demo_project)) - the ALM QC database username (e.g.
sa) - the password for the ALM QC database user
- Verify that the computer running the migration has access to the MySQL database of the TestRail instance that is the target of the migration. You will need:
- the TestRail database host
- the MySQL port (e.g.
3306) - the name of the TestRail database (e.g.
testrail) - the TestRail database root username (e.g.
root) - the password for the root TestRail database user
- Verify that the computer running the migration has access to the Cassandra database of the TestRail instance that is the target of the migration.
- one or more Cassandra database hosts
- the Cassandra port (e.g.
9042) - the name of the keyspace used by TestRail (e.g.
tr-keyspace) - a Cassandra database username (e.g.
cassandra) - the password for the Cassandra database user
- Ensure you have a spreadsheet application that is capable of viewing
.xlsxfiles, such as MS Excel, Apple Numbers, Google Sheets, or LibreOffice.
Attachment requirements
You will need to provide two paths to attachment file storage locations, one for ALM QC, where the current QC attachment files are located, and one for TestRail, where the attachment files will be copied during the migration.
The ALM QC attachment file storage location can be a mounted volume, or just a local copy of the QC attachment storage.
During the migration process, the ALM QC attachment files will be copied to the TestRail attachment storage location. If the TestRail attachment storage location is a mounted volume, then the attachment copy is complete after the migration. If not, the attachment directory can be copied to the TestRail instance attachment storage after the migration.
Migration usage
Docker and GitHub repository preparation
-
Clone this GitHub repository if you haven't already, with this command:
git clone git@github.com:gurock/tr-alm-migration - Log in to GitHub, and from settings, click "Generate new token" and generate a (classic) personal access token (PAT). You must provide a token name, such as
TestRail migration, an expiration, and the following scope:read:packages
- Click the green "Generate token" button.
- Be sure to copy and save the personal access token once you've generated it.
-
Use the following command to log in to the GitHub Container Registry (GHCR) with your username and the PAT you just generated:
export GHCR_PAT=<insert personal access token here> export GHCR_USER=<insert GitHub username here> echo $GHCR_PAT | docker login ghcr.io -u $GHCR_USER --password-stdin - Look for the
Login Succeededmessage. Now that you are logged in, you'll be able to pull thetr-data-migrationimage from GHCR,
by following the steps in the next section.
Container setup
-
Start the Docker container download and setup with the following commands:
cd tr-alm-migration ./run.sh start - The script begins by pulling the
tr-data-migrationimage from the GitHub Container Registry (GHCR). - At the prompt, enter the path for the ALM QC attachments storage directory.
- At the prompt, enter the path for the TestRail attachments storage directory.
- The
tr-data-migrationimage is then used to create two Docker containers, one running Airbyte, and the other running the migration data transformations. These Docker containers will be running in the background. - Three new directories will be created in your local copy of this repository:
-
/config- Contains configuration files for ALM QC and TestRail. -
/logs- Log files generated by the migrations you run will be stored here. -
/reports- Any migration reconciliation reports you generate will be stored here.
-
- If any of these directories already exist, they won't be modified by the script.
- Once you see the message
Airbyte containers are running!, the setup script is complete. By default, Airbyte will be running on port8000. -
To check the status of the Airbyte and TR ALM QC Docker containers, run the following command:
./run.sh status - Both containers should have a status of
running. You are now ready to configure the migration.
Migration configuration
Run the following command to configure settings for ALM QC, TestRail, and Cassandra:
./run.sh configureTip: If either the TestRail database or the ALM QC database is running in a Docker container, you will need to use host.docker.internal in place of localhost or 127.0.0.1 in the configuration files.
Follow the steps below at each prompt to complete the configuration:
ALM QC
- Enter the URL of the ALM QC database (
localhostby default). - Enter the MSSQL port (
1433by default). - Enter the name of the ALM QC database (
DOMAIN_project_dbby default). - Enter an ALM QC database username (
saby default). - Enter the database user's password.
- Enter the name of the ALM QC project database.
TestRail
- Enter the URL of the TestRail database (
localhostby default). - Enter the MySQL port (
3306by default). - Enter the name of the TestRail MySQL database (
testrailby default). - Enter the name of the root user for the TestRail MySQL database (
rootby default). - Enter the root user's password.
Cassandra
- Enter one or more Cassandra host URLs, separated by commas (
localhostby default). - Enter the Cassandra port (
9042by default). - Enter the name of the keyspace being used by TestRail (
tr_keyspaceby default). - Enter a Cassandra database username (
cassandraby default). - Enter the database user's password.
Once done, check the TestRail config and ALM QC config files for the updated settings. You can modify these files directly to make any needed changes.
For an in-depth explanation of the settings within the configuration files, refer to the configuration settings documentation.
Once you see the message, "Successfully set the global variable 'local_infile' to true", you are now ready to migrate the ALM QC data with Airbyte.
Airbyte migration (Extract-Load)
-
Run the following command to start the Airbyte migration:
/run.sh airbyte - This script will extract data from the ALM QC database and load it into newly created Airbyte tables in the TestRail database. These tables, all of which are prefixed with
_airbyte_raw_, will later be used to migrate the data into TestRail tables. - For informational purposes, you can access the Airbyte UI at the URL and port specified in its configuration. The default URL is
localhost:8000. - Once you see the message
✅Job finished!with a status ofsucceeded, the Airbyte migration is complete.
ALM QC migration scripts (Transform)
-
To begin migrating the data corresponding to the project specified in the configuration steps, run the following command:
./run.sh migrate - Enter
migrateat the prompt to confirm that you're ready to migrate the data to TestRail. - This will begin the migration process. Each migration script will run in sequence, and will output logs to both the console and to a log file in the
/logsdirectory. - Once you see the message
ALM QC migration complete!, the migration is finished. The full list of migration scripts are documented in in the QC migration scripts documentation. -
To migrate attachment files from ALM QC to TestRail (e.g. image files, text files, etc.), run the following command:
./run.sh migrate-attachments - Confirm that you're ready to migrate the attachment files by entering
migrateat the prompt. - Once confirmed, the script will copy attachment files from the ALM QC attachment storage location to the TestRail attachment storage location. The script will output logs to both the console and to a log file in the
/logsdirectory. - You may see warnings about missing attachment files if they are not found, but the migration will continue without issue if the first copy attempt succeeds.
- Once you see the message
ALM QC attachment migration complete!, the migration is finished. - If you need to migrate another project from ALM QC to TestRail, you can re-run the migration scripts with the new project's configuration, starting here.
Reconciliation reporting
-
To generate a migration reconciliation report showing the data that was migrated from ALM QC to TestRail (and the data that was not migrated), run the following command:
./run.sh report - The script will output a spreadsheet in the
/reportsdirectory, showing the reconciliation of data between ALM QC and TestRail. A command to open the report will be displayed in the console (e.g.open ./reports/alm-report-2024-06-28T15:00:00Z.xlsx). The command will open the report in your default spreadsheet application.
Additional information
Cleaning migrated data
Cleaning migrated data means removing all the data that was copied to TestRail as a result of running the migration. Only perform this step if you want to "rollback" the migration and remove the migrated data.
-
After you've run the migration scripts, you may choose to remove the migrated data from the TestRail database. To do this, run the following command:
./run.sh clean - Enter
cleanat the prompt to confirm that you're ready to remove the migrated data from TestRail. - Once confirmed, the script will remove the migrated data from the TestRail database. No data that already existed in TestRail separately from the migration will be removed. The script will output logs to both the console and to a log file in the
/logsdirectory.
Cleaning airbyte data
Cleaning Airbyte data means removing all the data that was extracted from ALM QC and loaded into the TestRail database. This data contains a ledger record of the resulting transformation and migration of the data into the TestRail tables. If you remove the Airbyte data you will no longer be able to use this ledger record to clean the migrated data from TestRail in a migration "rollback".
-
Once you've cleaned the migrated data from TestRail, you may want to remove the Airbyte tables that were created during the Airbyte migration. To do this, run the following command:
./run.sh clean-airbyte - Enter
cleanat the prompt to confirm that you're ready to remove the Airbyte tables from the TestRail database. - Once confirmed, the script will remove the Airbyte tables from the TestRail database. The script will output logs to both the console and to a log file in the
/logsdirectory.
Stopping the Docker containers
When you have completed the migration, you will want to stop the migration's Docker containers.
To bring down the Docker containers, run the following command:
./run.sh stopThis will not remove the containers or their data.
Removing the Docker containers
To remove the Docker containers and reset to the initial state, run the following:
./run.sh resetEnter y for yes at the prompt to confirm that you want to reset the container.
This command will stop and remove the container, and remove the following directories and their contents:
/config/logs/reports
Then run:
./run.sh reset-airbyteEnter y for yes at the prompt to confirm that you want to reset the container.
This command will stop and remove the container.
Additional commands
You can see a full list of available commands by running:
./run.sh helpSome seldom needed additional commands are available.
In some rare circumstances, it may be helpful to run individual data transformation jobs.