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
- Run a database backup on the old server - /opt/vprotect/scripts/backup_db.sh /path/to/scratch/file.mysql.gz
- Copy that scratch file somewhere safe (onto your workstation, via scp or rsync)
- Install your new EL8 server
- Follow https://storware.gitbook.io/backup-and-recovery/deployment/installation-overview/installation-with-rpms UNTIL starting the service
- Copy the database backup to the new server
- Restore the backup: gunzip < PATH_TO_GZIPPED_BACKUP | mysql -u root -p vprotect
- If you don't know the mysql / MariaDB root password, you'll need to reset it:
- systemctl stop mariadb
- mysqld_safe --skip-grant-tables &
- mysql -u root
- mysql> FLUSH PRIVILEGES;
- mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MY_NEW_PASSWORD';
- mysql> quit;
- mysqladmin -u root -p shutdown
- systemctl start mariadb
- Re-attempt the restore above.
- Now start the server - but I'd recommend to start the server in a session as opposed to using systemd
- sudo -u vprotect sh
- /opt/vprotect/api_start.sh
- Enter your mysql / MariaDB root password as prompted
- Monitor the service startup with tail -f /opt/vprotect/logs/appserver/server.log.0
- This script will eventually return when it's finished starting up.
- Once it's started, stop it with /opt/vprotect/api_stop.sh and then start it with systemd: systemctl start vprotect-server
- This will take a while to start up, especially if there's a version upgrade (like in my case)
- Re-install the node, setup your mount points etc.
- Don't forget to re-install your license!
- 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
Links
- https://storware.gitbook.io/backup-and-recovery/administration/upgrade - Snippet on creating a backup of the system
- https://storware.gitbook.io/backup-and-recovery/troubleshooting/disaster-recovery - Overall restoration procedure
- https://storware.gitbook.io/backup-and-recovery/deployment/installation-overview/installation-with-rpms - Overall installation procedure
- https://linuxize.com/post/how-to-reset-a-mysql-root-password/ - Reset mysql password
- https://sebhastian.com/mysql-skip-grant-tables-error-fix/ - mysql flush privs first because the tables aren't loaded