Restoring from backup
|
If you have lost your configuration files, you will need to restore them before you will be able to restore databases. To restore your configuration files from backup, you can find a recent configuration backup under the /srv/vaisala/radarsw/backup directory to restore and then run the following command:
|
- Log in to the server as root.
-
Stop the Monit service:
systemctl stop monit.service -
Stop the IRIS Focus web application:
systemctl stop vaisala-radarsw-webapp.service -
Stop all services which might access the database.
kubectl delete -f /etc/vaisala/focus/k8s/vaisala-focus.yaml -
(Optional) Run the backup script:
/usr/vaisala/radarsw/backup/bin/do-backups
Database backups for the wx and vsp databases will be in /srv/vaisala/radarsw/backup/database. Move a copy to a remote host if reinstalling or otherwise reimaging the machine. -
Drop the current database with the
rsw-db-toolutility:rsw-db-tool drop-db -
Drop the current database with the
rsw-vsp-db-toolutility:rsw-vsp-db-tool drop-db -
Drop the current keycloak database using the rsw-api-auth-tool:
rsw-api-auth-tool delete-db --no-prompt -
Recreate an empty wx database:
rsw-db-tool create-db -
Create an empty keycloak database:
rsw-api-auth-tool create-db -
Recreate an empty vsp database:
rsw-vsp-db-tool create-db -
Copy your database backup files back to the Focus server and restore the database
contents by reading the file contents into the standard output stream and inserting them
in the IRIS Focus databases:
ext=2019-10-12T07-54-50.gz pre=radarsw-database gzip -dc ${pre}-vsp-${ext} | psql -d vsp_v1 -U vsp_user -h localhost gzip -dc ${pre}-wx-${ext} | psql -d wxdb2 -U wxuser -h localhost gzip -dc ${pre}-keycloak-${ext} | psql -d keycloak -U keycloak -h localhost -
Restart services which might use database.
kubectl apply -f /etc/vaisala/focus/k8s/vaisala-focus.yaml -
Start the IRIS Focus web application:
systemctl start vaisala-radarsw-webapp.service -
Start the Monit service:
systemctl start monit.service
