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
- Download and install the Docker Toolkit, if necessary. See the Docker website for instructions on how to
install it.
- Update your local_settings.py file.
- Connect to the 7.0 MobileFirst
Quality Assurance development server by
using SSH, if you are not already connected.
- Open the /home/utest/apphance/project/src/apphance/local_settings.py file.
- 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 |
- Save and exit.
- Enable remote access to the postgres server.
- Open the /var/lib/pgsql/data/pg_hba.conf file.
- Add the following host to the bottom of the list:
host all all ip_address_of_machine_running_the_docker_image/24 trust
- Save and exit.
- Open the /var/lib/pgsql/data/postgresql.conf file.
- Search for #listen_addresses.
- Uncomment the listen addresses by removing the leading
#.
- Replace the content within the single quotation marks
with an asterisk (*).
- Go to the /etc/init.d directory.
- Restart the postgres server by running the following
command:
./postgresql restart
- Modify your IP tables.
- Create a text file of your IP information by entering
the following command:
iptables-save > iptab.conf
- Open the iptab.conf file that you
created with a text editor.
- 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
- Commit the changes that you made to the IP tables by
entering the following command:
iptables-restore < iptab.conf
- Copy your files from the server to the machine with the
Docker image.
- Create a directory on the machine that contains the
Docker image where the files can be copied, and go to the directory.
- 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:
- Start an sftp connection with the server where the files are by
entering a command similar to the following:
sftp root@mqa_server
- Enter the password for the root ID.
- Go to the /home/utest/apphance/var directory.
- Enter the copy command similar to the following example:
get -r uploads
- Download the mqa-migration-toolkit Docker
image.
- Start the Docker daemon by entering the following command:
docker-machine start default
- Log in to your Docker instance by entering the following
command:
docker login quay.io
- Enter the Docker login ID for the image, which is: applauseops+ibm_customer.
- Enter the password for the image, which is:
9A2XGC9MT0YYUXF2OASGQTD92TOQVX5IFO96J484NP1KX73Z6M1I
7Q4LC26ZNO9Q
- Download the image by entering the following command:
docker pull quay.io/applauseops/mqa-migration-toolkit
- Configure Secure Sockets Layer (SSL) certificates to the
Docker image.
- 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
- Go to the /home/utest/apphance/etc/pki directory
of the MobileFirst
Quality Assurance server.
- 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.
- Go to the /before-django-17/venv/lib/python2.7/site-packages/requests directory
on the machine with the Docker image.
- Paste the certificate contents at the end of the cacert.pem script
file.
- Note the image number that is listed after your user
name in your command prompt, and exit the Docker instance.
- 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.
- 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
- Enter no when asked if you want
to delete content types by a foreign key.
- Enter no when asked if you want
to delete the stale content that is related to distributions.
- Enter no when asked if you want
to delete the stale content that is related to builds.
- 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
- 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:
- 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.
- Resolve the error that is identified after that statement.
Tip: Ensure that services are accessible for the MobileFirst
Quality Assurance toolkit.
- 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.