/
KB 10146 How to move database to remote server

KB 10146 How to move database to remote server

KB ID: 10146

Product: Storware Backup & Recovery

Version: 5.x 6.x

Published: 2023-07-31

Last modified: 2023-07-31

Problem

How to move vprotect database into remote database server.

Solution

  1. Stop Storware Backup & Recovery server: # systemctl stop vprotect-server

  2. Create database backup from existing server: # /opt/vprotect/scripts/backup_db.sh

  3. Copy /tmp/vprotect_db.sql.gz to MariaDB server (example # scp /tmp/vprotect_db.sql.gz root@mariadb.server.address:/tmp)

  4. Create database (example # mysql -uroot -pROOTDBPASSWORD -e "create database vprotect character set utf8 collate utf8_unicode_ci")

  5. Create user with privileges for vprotect database:

    mysql -uroot -pROOTDBPASSWORD -e "CREATE USER 'vprotect'@'localhost' IDENTIFIED BY 'DBPassword'" mysql -uroot -pROOTDBPASSWORD -e "GRANT ALL PRIVILEGES ON vprotect.* TO 'vprotect'@'localhost' WITH GRANT OPTION" mysql -uroot -pROOTDBPASSWORD -e "CREATE USER 'vprotect'@'%' IDENTIFIED BY 'DBPassword'" mysql -uroot -pROOTDBPASSWORD -e "GRANT ALL PRIVILEGES ON vprotect.* TO 'vprotect'@'%' WITH GRANT OPTION" mysql -uroot -pROOTDBPASSWORD -e "FLUSH PRIVILEGES"
  6. import database into MariaDB: gunzip < PATH_TO_GZIPPED_BACKUP | mysql -uroot -pROOTDBPASSWORD vprotect

  7. On Server Machine edit # vi /opt/vprotect/payara.properties

  8. Uncomment and set correctly variables (if you use FQDN names you need to set it in /etc/hosts or in DNS server). You need set address to MariaDB, listening port and Password to database:

    eu.storware.vprotect.db.host=mariadb.server.address eu.storware.vprotect.db.port=3306 [...] eu.storware.vprotect.db.password=DBPassword

     

  9. Start Storware Backup & Recovery server: # systemctl start vprotect-server

  10. If necessary restart nodes # systemctl start vprotect-node

 

Related content

KB 10144 How to exclude one of VM disk from backup
KB 10144 How to exclude one of VM disk from backup
Read with this
KB10026 How to manually change the location of vProtect database
KB10026 How to manually change the location of vProtect database
More like this
KB 10145 Storware Backup & Recovery cannot take backup of VM with vTPM on Nutanix
KB 10145 Storware Backup & Recovery cannot take backup of VM with vTPM on Nutanix
Read with this
KB10034 How to manually restore vProtect databse from sql file
KB10034 How to manually restore vProtect databse from sql file
More like this
KB10039 vProtect cannot backup its own database via GUI
KB10039 vProtect cannot backup its own database via GUI
More like this
KB10049 How to backup vProtect database by remote node.
KB10049 How to backup vProtect database by remote node.
More like this