4. Windows machines - Migrate data from MySQL to PostgreSQL

  IMPORTANT:

  • Follow this instruction to create a Backup of both your PostgreSQL(Sessions) and MySQL(qTest) databases before attempting to migrate
  1. Download the migration tool to your local machine
  2. Extract the downloaded package
  3. Access to the extracted folder above

    extracted-folder
  4. Open file application.properties and edit the following required information
    #Replace clientdb2 with the name of your current qTest 7.7.3 MySQL database
    datasource.source.originDatabase=clientdb2
    #MySQL database host address
    datasource.source.host=localhost
    #MySQL listen port(Default 3306)
    datasource.source.port=3306
    #clientdb2clone - Name of MySQL database clone that will be created to migrate data to PostgreSQL.
    datasource.source.database=clientdb2clone
    #MySQL user, this user must be granted create database privileges.
    datasource.source.username=root
    #MySQL password
    datasource.source.password=root

    # PostgreSQL server host address
    datasource.destination.host=localhost
    # PostgreSQL listen port(default 5432)
    datasource.destination.port=5432
    # PostgreSQL database that will be created during this migration
    datasource.destination.database=qtest2
    # PostgreSQL User, this user must be granted create database privileges
    datasource.destination.username=postgres
    # PostgreSQL Password
    datasource.destination.password=root

    # This database must already exist, it is used to log into postgres and create the destination.database
    datasource.predestination.database=postgres
    Key Description
    datasource.source.originDatabase Name of your qTest's database on MySQL
    datasource.source.host IP of your MySQL server
    datasource.source.port Port number of your MySQL server
    datasource.source.database Enter a non-existing database name on your MySQL server. The tool will clone the datasource.source.originDatabase to datasource.source.database and it will migrate data in the clone database
    datasource.source.username User name to log in to your MySQL server
    datasource.source.password Password to login to your MySQL server
    datasource.destination.host IP of your PostgreSQL server
    datasource.destination.port Port number of your PostgreSQL server
    datasource.destination.database Name of a non-existing PostgreSQL database where the data will be migrated to
    datasource.destination.username User name to log in to your PostgreSQL server
    datasource.destination.password Password to log in to your PostgreSQL server
    datasource.predestination.database Enter any existing database which can be accessed by the above PostgreSQL credentials. It is needed so that the tool can create a new database in Postgres. The tool will not use its data
  5. After you have done modifying the file, save and close it
  6. Open Console window and access to the extracted folder
  7. Run the following command to start the migration process

    java -jar qtest-onpremise-postgres-migration-0.0.1.jar
    		
  8. After the progress is completed, your qTest database in MySQL is migrated to PostgreSQL as defined in the table above and a back-up of your MySQL database is downloaded to your local machine in the same location with the executed jar file