Restore vProtect Server from backup

I needed to migrate my vProtect server from CentOS 7 to something EL8 based. As there's no good way to in-place upgrade, I needed to "restore" the vProtect server installation on to a new install.

My Scenario

  • 1x "old" CentOS 7 vProtect 4.3.x server
  • 1x "new" RHEL 8 vProtect 5.0.x server

Steps

  1. Run a database backup on the old server - /opt/vprotect/scripts/backup_db.sh /path/to/scratch/file.mysql.gz
  2. Copy that scratch file somewhere safe (onto your workstation, via scp or rsync)
  3. Install your new EL8 server
  4. Follow https://storware.gitbook.io/backup-and-recovery/deployment/installation-overview/installation-with-rpms UNTIL starting the service
  5. Copy the database backup to the new server
  6. Restore the backup: gunzip < PATH_TO_GZIPPED_BACKUP | mysql -u root -p vprotect
    1. If you don't know the mysql / MariaDB root password, you'll need to reset it:
    2. systemctl stop mariadb
    3. mysqld_safe --skip-grant-tables &
    4. mysql -u root
    5. mysql> FLUSH PRIVILEGES;
    6. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MY_NEW_PASSWORD';
    7. mysql> quit;
    8. mysqladmin -u root -p shutdown
    9. systemctl start mariadb
    10. Re-attempt the restore above.
  7. Now start the server - but I'd recommend to start the server in a session as opposed to using systemd
    1. sudo -u vprotect sh
    2. /opt/vprotect/api_start.sh
    3. Enter your mysql / MariaDB root password as prompted
    4. Monitor the service startup with tail -f /opt/vprotect/logs/appserver/server.log.0
    5. This script will eventually return when it's finished starting up.
    6. Once it's started, stop it with /opt/vprotect/api_stop.sh and then start it with systemd: systemctl start vprotect-server
  8. This will take a while to start up, especially if there's a version upgrade (like in my case)
  9. Re-install the node, setup your mount points etc.
  10. Don't forget to re-install your license!
  11. If your node name changed, re-assign the node-config to it: Nodes > Instances > Tick new node > Assign Node Config > Select previous node config

Troubleshooting:

  • journalctl -fn100 will show you if something is attempting to connect to mysql and failing auth:
[Warning] Access denied for user 'root'@'localhost' (using password: NO)
  • If this is the vprotect user, you'll need to make sure /opt/vprotect/payara.properties contains the following lines:
eu.storware.vprotect.db.user=vprotect
eu.storware.vprotect.db.password=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • /opt/vprotect/logs/api/api.log contains the API log.
  • /opt/vprotect/logs/appserver/server.log.0 contains the "application" server log - this starts up after the API server

If you get an issue, start "over" like I had to.

dnf remove vprotect-server-5.0.0-75.el8.x86_64 --setopt=clean_requirements_on_remove=false
mysql -u root -p
mysql> drop database vprotect;
mysql> drop user vprotect;
myqsl> quit;
rm -rf /opt/vprotect