Migrating data to version 7.0

After upgrading IBM MobileFirst Quality Assurance to version 7.0, you must migrate your existing data.

Before you begin

  • Software that enables you to SSH to a remote server.
  • Docker Toolkit

About this task

Data for your MobileFirst Quality Assurance version 6.3 must be migrated to use with version 7.0. To migrate your data, complete the following steps:

Procedure

  1. Download and install the Docker Toolkit, if necessary. See the Docker website for instructions on how to install it.
  2. Update your local_settings.py file.
    1. Connect to the 7.0 MobileFirst Quality Assurance development server by using SSH, if you are not already connected.
    2. Open the /home/utest/apphance/project/src/apphance/local_settings.py file.
    3. Update the following URLs:
      Table 1. Updates to the local_settings.py file
      URL name New URL
      BUAPS_BASE_URL https://URL_of_MQA_server:9443/api/v1
      STORAGE_SERVICE_URL https://URL_of_MQA_server:9443/api/v1
    4. Save and exit.
  3. Enable remote access to the postgres server.
    1. Open the /var/lib/pgsql/data/pg_hba.conf file.
    2. Add the following host to the bottom of the list:
      host all all ip_address_of_machine_running_the_docker_image/24 trust
    3. Save and exit.
    4. Open the /var/lib/pgsql/data/postgresql.conf file.
    5. Search for #listen_addresses.
    6. Uncomment the listen addresses by removing the leading #.
    7. Replace the content within the single quotation marks with an asterisk (*).
    8. Go to the /etc/init.d directory.
    9. Restart the postgres server by running the following command:
      ./postgresql restart
  4. Modify your IP tables.
    1. Create a text file of your IP information by entering the following command:
      iptables-save > iptab.conf
    2. Open the iptab.conf file that you created with a text editor.
    3. Add an IP entry after the entry that contains "...port 9443" that looks like the following line:
      -A INPUT -p tcp -m state --state NEW -m tcp --dport 5432 -j ACCEPT
    4. Commit the changes that you made to the IP tables by entering the following command:
      iptables-restore < iptab.conf 
  5. Copy your files from the server to the machine with the Docker image.
    1. Create a directory on the machine that contains the Docker image where the files can be copied, and go to the directory.
    2. Copy the /home/utest/apphance/var/uploads directory from the MQA server to the machine that contains the Docker image. One possible method is explained in the following steps:
      1. Start an sftp connection with the server where the files are by entering a command similar to the following:
        sftp root@mqa_server
      2. Enter the password for the root ID.
      3. Go to the /home/utest/apphance/var directory.
      4. Enter the copy command similar to the following example:
        get -r uploads
  6. Download the mqa-migration-toolkit Docker image.
    1. Start the Docker daemon by entering the following command:
      docker-machine start default
    2. Log in to your Docker instance by entering the following command:
      docker login quay.io
    3. Enter the Docker login ID for the image, which is: applauseops+ibm_customer.
    4. Enter the password for the image, which is:
      9A2XGC9MT0YYUXF2OASGQTD92TOQVX5IFO96J484NP1KX73Z6M1I
      7Q4LC26ZNO9Q
    5. Download the image by entering the following command:
      docker pull quay.io/applauseops/mqa-migration-toolkit
  7. Configure Secure Sockets Layer (SSL) certificates to the Docker image.
    1. Add the SSL certificate to the Docker image by entering the following command:
      docker run -t -i quay.io/applauseops/mqa-migration-toolkit /bin/bash
    2. Go to the /home/utest/apphance/etc/pki directory of the MobileFirst Quality Assurance server.
    3. Copy the contents of the certificate (*.crt) file, including the lines for the beginning of the certificate and the end of the certificate to the clipboard.
    4. Go to the /before-django-17/venv/lib/python2.7/site-packages/requests directory on the machine with the Docker image.
    5. Paste the certificate contents at the end of the cacert.pem script file.
    6. Note the image number that is listed after your user name in your command prompt, and exit the Docker instance.
    7. In the MobileFirst Quality Assurance server terminal, commit the changes to the cacert.pem file by entering the following command:
      docker commit -m "message" -a "user_id" \image_id mqauser/mqa-migration:v1
      Where the following are true:
      • The message is the message to return when the certification is complete.
      • The user_id is the user name for your Docker image.
      • The image_id is the image identifier for your Docker image that you noted from your command prompt.
    8. Run the Docker image migration script file by entering the following command:
       docker run -t -i -e BUAPS_HOST="server_URL_of_image:9443"
       -e DATABASE_URL="postgres://apphance:apphance@server_URL_of_image:
      5432/apphance" -v /path_to_uploads_file/uploads:/home/docker/app/uploads
      mqauser/mqa-migration:v1 fab localhost migrate
    9. Enter no when asked if you want to delete content types by a foreign key.
    10. Enter no when asked if you want to delete the stale content that is related to distributions.
    11. Enter no when asked if you want to delete the stale content that is related to builds.
  8. Stop and restart the services by entering the following command from the /opt/IBM/WQA/Apphance/setup directory on the MobileFirst Quality Assurance server:
    fab -H utest@mqa-host.example.com restart_supervisor
  9. Deploy the MobileFirst Quality Assurance server by entering the following command while you are in the /opt/IBM/WQA/Apphance/setup directory:
    fab -H utest@localhost deploy:use_working_dir=True

What to do next

If there was any problem with the migration, the following procedure can help to fix errors:
  1. Find the last line of the output that indicates a step that completed successfully. It should look like the following example:
    Step X completed successfully.
  2. Resolve the error that is identified after that statement.
    Tip: Ensure that services are accessible for the MobileFirst Quality Assurance toolkit.
  3. Restart the migration from the step after the last one that completed successfully by adding a colon (:) and the failed step number to the end of the migration command, like the following example:
     docker run -t -i -e BUAPS_HOST="server_URL_of_image:9443"
     -e DATABASE_URL="postgres://apphance:apphance@server_URL_of_image:
    5432/apphance" -v /path_to_uploads_file/uploads:/home/docker/app/uploads 
    mqauser/mqa-migration:v1 fab localhost migrate:12
    Where the migration failed after successfully completing step 11.