Upgrade Guide from 8.2.3 to 8.5.3
Prerequisites
WorkFusion SPA 8.2.X is operating on RHEL 6, while 8.5.X and higher require RHEL 7.3 or RHEL 7.4. So in-place upgrade is not possible.
WorkFusion 8.5.x should be installed prior to migration.
Provisions
The following provisions should be observed when using this guide.
WorkFusion Environments:
old-wf.workfusion.com: APP Server name in 8.2.3. For example,onprem-v2-552-8-2-3-wf.workfusion.comnew-wf.workfusion.com: WorkFusion Server names in 8.5. For example,aafs-844-852-db1.wfwf-10005.workfusion.com
WorkFusion installation directory:
/opt/workfusion/If in your environment WorkFusion is installed in another directory, use that directory instead.
WorkFusion default user: The default WorkFusion user is assumed as
wfuser.If in your environment the default user is different, use that username instead.
Ports: Ports used in this guide are default. Consider to change them in case different ports are configured in your environment.
Upgrade Procedure
Preparation
To successfully migrate all the platform components to a new environment, back up all the data in the storages and the databases.
Create a directory for dumps:
mkdir /opt/workfusion/dumpsStop the following services to proceed with the backup and make sure all the data are consistent.
/opt/workfusion/apps/wfagent/wfagent stop /opt/workfusion/apps/nexus/nexus/bin/nexus stop /opt/workfusion/apps/s3emu/riak.service stop
Data backup
MySQL
sudo -u wfuser -i
/opt/workfusion/lib/mysql/bin/mysqldump --routines -S /opt/workfusion/apps/mysql/mysql.sock -u root -p -B sqc -B wfdb >> /opt/workfusion/dumps/mysql-sqc_wfdb.sql
PostgreSQL
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/workfusion/lib/pgsql-9.4.7/lib
/opt/workfusion/lib/pgsql-client-9.4.7/bin/pg_dumpall -U postgres -h 127.0.0.1 -p 5432 > /opt/workfusion/dumps/postgres-all.sql
MongoDB
/opt/workfusion/lib/mongodb/mongodump --host 127.0.0.1 --port 27017 --username admin --password "myadminpass" --archive=/opt/workfusion/dumps/mongo-dump.tar
S3Emu
Find and save the riak-cs AWS keys from the 8.2.3 installation. They
are stored as a plain text in the /opt/workfusion/apps/s3emu/etc/s3cfgfasttrack file on APP Server.
s3emu-service stop
tar -czvf /opt/workfusion/dumps/riak.tar.gz /opt/workfusion/apps/s3emu/riak
Solr
solr-service stop
tar -czvf /opt/workfusion/dumps/solr.tar.gz /opt/workfusion/apps/solr
Nexus
nexus stop
tar -czvf /opt/workfusion/dumps/nexus.tar.gz /opt/workfusion/apps/nexus/sonatype-work/nexus
Check the additional data and passwords on the Application server and save them in the dumps directory:
cp -pr /opt/workfusion/webapps/apache-tomcat-8.0.33/conf/secure* /opt/workfusion/dumps
To speed up the download all data can be zipped.
tar -czvf /opt/workfusion/dump.tar.gz /opt/workfusion/dumps
Data migration
Copy
dumpsto the new DB Server. For this purpose, you can use any application which is the best for you. The default directory for dumps is/opt/dump/.Populate
secrets.ymlwith the AWS access and secret keys from 8.2.3 installation.Example keys:
s3_access_key: JOZXPHL1ZC8WXZAJ1111 s3_secret_key: qAEYOVLOViPjxk3Lbuj0wrDztf8fGJrqM1111w==Unpack the archive with
dumps.Move to the folder where
dumpswas stored on DB server.tar zxvf dump.tar.gzGo to the directory where you have extracted
dumpsto.
Data restoring
S3Emu
Unpack the archive with S3Emu backup from 8.2.3.
tar -xzvf riak.tar.gz
cp -r /opt/dump/dump/riak/* /opt/workfusion/riak/data/
The extracted riak directory should containt two subfolders only: leveldb and bitcask.
MySQL
mysql -u mysql -p -h 127.0.0.1
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sqc |
| sys |
| wfdb |
+--------------------+
6 rows in set (0.00 sec)
mysql> drop database sqc;
Query OK, 5 rows affected (0.03 sec)
mysql> drop database wfdb;
Query OK, 202 rows affected (1.04 sec)
mysql> quit
Replace the old URL and the user with the new ones in the MySQL dump.
In case your new environment runs on a port that differs from the one previously set, you should adjust the sed command in accordance with the new enviroment URL. For example, the old environment uses the port 4443 while the new one works on the
port 8443.
So, the sed command to replace the URL is as follows:
sed -i "s/old-wf\.workfusion\.com\:4443/new-wf\.workfusion\.com\:8443/g" mysql-dump.sql
sed -i s/mysqluser/WORKFUSION_DB_USER mysql-dump.sql
sed -i "s/old-wf\.workfusion\.com/new-wf\.workfusion\.com/g" mysql-dump.sql
In the code above, WORKFUSION_DB_USER is the user from secrets.yml, old-wf is the old APP Server, and new-wf is a new DB Server instance.
Upload the dump to MySQL.
mysql -u mysql -h 127.0.0.1 -p < mysql-sqc_wfdb.sql
PostgreSQL
Connect to PostgreSQL database
psql -U postgres -h 127.0.0.1Run the next queries in the PostgreSQL shell to remove connections that may prevent dropping of databases (you can copy and paste all of them to the PSQL shell and press Enter):
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'virtualizer_sandbox' AND pid <> pg_backend_pid(); SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'virtualizer' AND pid <> pg_backend_pid(); SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'wf_datastore' AND pid <> pg_backend_pid(); SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'wfml_automation' AND pid <> pg_backend_pid(); drop database virtualizer_sandbox; drop database virtualizer; drop database wf_datastore; drop database wfml_automation;Replace the old url in PostgreSQL 8.2.3 dump with the new one.
In case your new environment runs on a port that differs from the one previously set, you should adjust the sed command in accordance with the new enviroment URL. For example, the old environment uses the port 4443 while the new one works on the
port 8443.
So the sed command to replace the URL is as follows:
sed -i "s/old-wf\.workfusion\.com\:4443/new-wf\.workfusion\.com\:8443/g" postgres-all.sql
sed -i "s/old-wf\.workfusion\.com/new-wf\.workfusion\.com/g" postgres-all.sql
Restore data from the PostgreSQL 8.2.3 dump:
psql -U postgres -f postgres-all.sql
In the code above, postgres is the PostrgeSQL user from secrets.yml.
MongoDB
Restore the database from backup.
mongorestore --host 127.0.0.1 --port 27016 --username mongodb --password "mongodb" --archive=mongo-dump.tar
Nexus
tar -xvzf nexus.tar.gz
cd opt/workfusion/apps/nexus/
wfmanager stop nexus
cp -r sonatype-work/* /opt/workfusion/nexus/sonatype-work/
Solr
wfmanager stop solr
cp -r solr/* /opt/workfusion/solr/
DB
Apply DB migrations:
cd /opt/workfusion/workfusion/migrations_workfusion migrate pending --env=development migrate up --env=developmentRemove postmigrate scripts to prevent from deletion of custom Control Tower roles from the database.
cd <directory_with_ansible_installer_8.5.3> rm -f roles/init-sqldb/templates/scripts/*Go to the installer directory.
Run as
wfuser./install.sh install db
Vault
Upload the user secrets from 8.2.3 Business Process to Vault:
cd /opt/workfusion/wf-sec-storage mkdir _upgrade cp secure-store*.txt _upgrade/Use the following command to list all secrets:
cd wf-sec-storage ./loader.sh workfusion showCopy the output to a text file (
prop.file).In the text file, substitute
:with=and remove the spaces before and after=.Run the following command to update the secure properties:
./loader.sh workfusion prop.fileRestart tomcat
APP Server upgrade
Connect to APP Server.
Apply migrations for the SQC, Virtualizer, Virtualizer-sanbdox databases.
cd /opt/workfusion/workfusion/migrations_workfusion migrate pending --env=development migrate up --env=developmentGo to the Ansible installer directory.
Run as
wfuser:./install.sh install appRestart applications to apply changes:
wfmanager restart all
VDS Server upgrade
Connect to VDS Master Server.
Go to the Ansible installer directory.
Run as
wfuser../install.sh install vds-masterCopy the old models file from
s3://vds-models/models.prodto a temporary directory:s3cmd -c /opt/workfusion/s3cmd_conf/workfusion_s3cfg --signature-v2 sync s3://vds-models/models.prod /tmp/Copy the new models file from
s3://vds-models/models.flat-prodto a temprorary directory:s3cmd -c /opt/workfusion/s3cmd_conf/workfusion_s3cfg --signature-v2 sync s3://vds-models/models.flat-prod /tmp/Merge these files to a new one:
cat /tmp/models.prod >> /tmp/models.flat-prodUpload the merged file to
s3://vds-models/models.flat-prod:s3cmd -c /opt/workfusion/s3cmd_conf/workfusion_s3cfg --signature-v2 sync /tmp/models.flat-prod s3://vds-models/models.flat-prod
RPA Server upgrade
Perform the upgrade steps for RPA Server as described in RPA Server upgrade.