Cold backup and restore
Important notes
Currently, the backup and restore process cannot be used as a part of the migration process if DNS names are changed. This is due to the fact that the VAULT DB component will contain records with old DNS names from the previous installation.
This backup script can backup and restore only SPA data components.
From SPA 9.0.0 on, TLS certificates, config.yml and secrets.yml can be found in the distr archive in backup directory once the backup has been performed. You can use them in restore process.
important
In SPA 8.5.X, backup scripts were incorporated in the Ansible installer. Since SPA 9.0 backup scripts are a part of the product and located in
<INSTALL_DIR>/tools/cold-backup
General information
The Ansible installation comes with a script that implements the following cold backup solution design:

Backup script
wf-backup.sh { OPERATION } { COMPONENT } { ROLE }
$ ./wf-backup.sh
Usage:
./wf-backup.sh {prepare,backup,restore}
{all,mysql,postgresql,riak,minio,mongodb,vault,nexus,rpa-manager,distr} {apm,db,app} [EXTRA_VARS...]
Examples:
./wf-backup.sh prepare all db
./wf-backup.sh backup all db
./wf-backup.sh restore all db
./wf-backup.sh backup rpa-manager app
./wf-backup.sh restore rpa-manager app
./wf-backup.sh backup mongodb apm
./wf-backup.sh restore mongodb apm
Available procedures
The backup script supports 3 possible operation:
- Prepare (optional)
Hot-sync data: It is part of the backup operation, but can be launched separately before the main backup process to achieve minimal downtime. - Backup
All SPA services are turned off, components are archived. Once completed, the services are restarted. - Restore
The script searches for backup archives in the backup directory and performs the restore process.
Components for backup
Depending on the server role (APM, DB, APP), the script supports backup and restoration of the following components:
DB ROLE:
- MySQL
- PostgreSQL
- MiniIO
- MongoDB
- Vault
- Nexus
APM ROLE:
- MongoDB
APP ROLE:
- rpa-manager
Variables used in backup script
$ cat secrets.yml
mysql_admin_user : mysql
mysql_admin_pass: mysql
postgresql_admin_user: postgres
$ cat config.yml
install_dir: /opt/workfusion
backup_directory: '{{ install_dir }}/backup'
Backup procedure
DB server
Run prepare (hot-sync step)
$ ./wf-backup.sh prepare all db
The script copies (hot-sync) all database components to {{ backup_directory }}.
Result
$ ls -1 /opt/workfusion/backup/
mongodb_db
mysql
nexus
postgres
riak
rpa-manager
vault
Shutdown APP services
note
This step should be executed not on the DB Server, but run manually on the APP Server.
$ wfmanager stop all
Run main backup step
./wf-backup.sh backup all db
The script checks if there are no external connections to WF databases, shuts WF services down, and performs cold-sync of database component files. After all, the files are archived.
As a result, in your {{ backup directory }}, you will find the archives with backups of the component's content:
$ ls -1 /opt/workfusion/backup/
...
mongodb_db-1516797995.tar.gz
mysql-1516797995.tar.gz
nexus-1516797995.tar.gz
postgres-1516797995.tar.gz
riak-1516797995.tar.gz
vault-1516797995.tar.gz
Move these archives to backup storage
APP Server
Run main backup step
$ ./wf-backup.sh backup all app
Result
$ ls -1 /opt/workfusion/backup/
rpa-manager-1516800559.tar.gz
Move this archive to backup storage
APM Server
Run main backup step
$ ./wf-backup.sh backup all apm
Result
$ ls -1 /opt/workfusion/backup/
mongodb_apm
mongodb_apm-1516865538.tar.gz
Move this archive to backup storage
Restore Procedure
DB server
Run installation first (as root)
$ ./install.sh precheck db && ./install.sh preinstall db
$ su - wfuser
$ ./install.sh install db && ./install.sh check db
Put backup archives with DB components into backup directory
Run restore command.
note
All services on APP Server should be stopped!
./wf-backup.sh restore all db
Verify that services started successfully
$ wfmanager status
APM Server
Run installation first (as root)
$ ./install.sh precheck apm && ./install.sh preinstall apm
$ su - wfuser
$ ./install.sh install apm && ./install.sh check apm
Put backup archives with APM components into backup directory
Run restore command
$ ./wf-backup.sh restore all apm
Verify that services started successfully
$ ./wfmanager status
APP Server
Run installation first (as root)
$ ./install.sh precheck app && ./install.sh preinstall app
$ su - wfuser
$ ./install.sh install app && ./install.sh check app
Put backup archives with APP components into backup directory
Run restore command
$ ./wf-backup.sh restore all app
Verify that services started successfully
$ ./wfmanager status