Migrate from v8.2.x to v9.2.x
The guide describes the steps for SPA migration from 8.2.x to 9.2. This guide does not include the migration of business processes.
Do not change passwords when performing this upgrade. Use the same passwords from your SPA 8.2.x installation.
Do not use dots "." in paths
Changelog
- Product architecture changes.
- [Security improvements] Introduced supervisord as user space systemd alternative. It used to manage all required daemons.
- [Security improvements] Added nginx on every linux server (except vds agent) to terminate TLS channel encryption. It requires TLS certificates on installation stage.
- [Security improvements] Moved all sensitive data into vault.
- [Stability improvements] Riak replaced with minio as s3 backend.
- [Deprecation] Solr component is not installed by default.
- Major components changes:
- [Version upgrade] Mysql upgraded 5.6 to 5.7
- [Version upgrade] Postgres 9.4 to 9.6
- [Component replaced] Riak → Minio
- [Version upgrade] Tomcat upgraded from 8.0.33 to 8.5.32
Prerequisites
- As WorkFusion SPA 8.2.x is operating on RHEL 6, while 8.5.x and higher require **RHEL 7 **- new line of servers will be required for the procedure.
- Prepare new line of servers:
New line of servers capacity planning, based on the existing processing requirements and future needs
Estimate development effort for migrating away from the deprecated functionality
- Deprecation notices
- Usage Report Tool
- Migration notes
Define migration timeline (Dev, UAT, Prod) and align with the stakeholders
- Workfusion 9.2.x product install packages are copied and extracted to <PACKAGE_DIR> across the servers
- Collect required data from previous installation:
- Licenses (OCR, Analytics)
- Customizations (third-party libraries, etc.)
- Configurations (for populating
secrets.ymlandconfig.ymlfiles)
- Follow the installation guide.
Data backup and migration
Preparation
To successfully migrate all the platform components to a new environment, backup 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
Data backup
MySQL
sudo -u wfuser -i
/opt/workfusion/lib/mysql/bin/mysqldump --max_allowed_packet=1024M --routines -S /opt/workfusion/apps/mysql/mysql.sock -u root -p -B sqc -B wfdb >> /opt/workfusion/dumps/mysql-dump.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
Check how much space your S3 storage takes
s3cmd -c /opt/workfusion/apps/s3emu/etc/s3cfgfasttrack du -H | grep TotalEnsure that you have enough disk space.
Create script that will backup S3 data
cat << 'EOF' > backup-s3.sh #!/bin/bash BUCKET_LIST=$(s3cmd --signature-v2 -c /opt/workfusion/apps/s3emu/etc/s3cfgfasttrack ls | cut -d'/' -f3); \ for i in $BUCKET_LIST; do mkdir -p /opt/workfusion/dumps/wf-s3-content/$i && \ s3cmd --signature-v2 -c /opt/workfusion/apps/s3emu/etc/s3cfgfasttrack get -f -r s3://$i /opt/workfusion/dumps/wf-s3-content/$i; done EOFMake it executable and launch it
chmod +x backup-s3.sh ./backup-s3.shArchive wf-s3-content
tar -czvf /opt/workfusion/dumps/wf-s3-content.tar.gz /opt/workfusion/dumps/wf-s3-content
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 dumps to the new DB Server. For this purpose, you can use any application which is the best for you.
Default directory for dumps:mkdir /opt/workfusion/dump/
Unpack the archive with dumps
move to folder where dumps were stored on DB server
tar zxvf dump.tar.gzand go to the directory where you have extracted the dumps to.
Data restoring
S3Emu
Unpack the archive with S3Emu backup from 8.2.3.
tar -xzvf wf-s3-content.tar.gz
cp -r opt/workfusion/dumps/wf-s3-content/* /opt/workfusion/minio/data/
MySQL
$ mysql -u mysql -p -h 127.0.0.1
Enter password:
Enter password which was used during 9.2 installation ( mysql_admin_pass in secrets.yml )
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
This need to be done only if new installation URL differs from previous e.g. if port is changed or URL switched from http to https
Example: old environment used port 80 non-TLS while the new one should work on port 443 with TLS
sed -i "s%http://wfapp.workfusion.com%https://wfapp.workfusion.com%g" mysql-dump.sql
Example: old environment used port 443 while the new one should work on 8443 port
sed -i "s%https://wfapp.workfusion.com%https://wfapp.workfusion.com:8443%g" mysql-dump.sql
Replace definer user for stored procedures:
WORKFUSION_DB_USER is the user from secrets.yml
sed -i s/mysqluser/WORKFUSION_DB_USER/g mysql-dump.sql
Upload the dump to MySQL
mysql -u mysql -h 127.0.0.1 -p < mysql-sqc_wfdb.sql
PostgreSQL
Connect to PostgreSQL database
postgresadmin is the user postgresql_admin_user from secrets.yml
psql -U postgresadmin -h 127.0.0.1
Run 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;
\q
Replace the old url in PostgreSQL 8.2.3 dump with the new one:
This need to be done only if new installation URL differs from previous e.g. if port is changed or URL switched from http to https
Example: old environment used port 80 non-TLS while the new one should work on port 443 with TLS
sed -i "s%http://wfapp.workfusion.com%https://wfapp.workfusion.com%g" postgres-all.sql
Example: old environment used port 443 while the new one should work on 8443 port
sed -i "s%https://wfapp.workfusion.com%https://wfapp.workfusion.com:8443%g" postgres-all.sql
Restore data from the PostgreSQL 8.2.3 dump:
psql -U postgresadmin -h 127.0.0.1 -f postgres-all.sql
postgresadmin 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
In the code above:
--username mongodbis the rpa_manager_db_admin_user from secrets.yml--password mongodbis the rpa_manager_db_admin_pass from secrets.yml
Nexus
tar -xvzf nexus.tar.gz
cd opt/workfusion/apps/nexus/
wfmanager stop nexus
cp -r sonatype-work/* /opt/workfusion/nexus/sonatype-work/
DB
Apply DB migrations.
Go to the installer directory.
Run as
wfuser./install.sh install db
If something went wrong with DB migrations
DB migrations can fail due to different reasons. If migration falls – the migration scripts are not deleted. The algorithm to resolve that issue is the following:
- Go to migration folder that has failed migration. That could be
one of:
/opt/workfusion/_migrations/workfusion/opt/workfusion/_migrations/workspace/opt/workfusion/_migrations/sandbox/opt/workfusion/_migrations/sqc
- Run
migrate pending.You should see the migration that fails and the error that happens. - Update sql script for migration and/or apply DB changes. You can
find the script in
scriptsfolder. - Run
migrate pendingagain. Repeat steps 2,3,4 until you successfully applied all migrations. - Run
./install.sh install dbfrom installer directory again.
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 reviewCopy the output to a text file (
prop.file).In the text file substuitute '
:' with '=' and remove the spaces before and after '='.Run the following command to update the secure properties:
./loader.sh workfusion prop.file
VDS Server upgrade
Connect to VDS Master Server
Go to the installer directory
Run as
wfuser./install.sh install vds-master
RPA Server upgrade
Perform the upgrade steps for RPA Server as described in 9.2.x RPA Server Upgrade.
BI Server upgrade
Perform the upgrade steps for BI Server as described in Upgrade BI Server Upgrade.