VISULOX 5 Documentation

Database Backup Guide


Scope:

Automatic and manual PostgreSQL database backup and restore for VISULOX.

Purpose

This document describes how VISULOX database backups work, how to create manual backups, and how to restore the database if needed.

VISULOX automatically creates periodic backups of its PostgreSQL database after setup is completed using setup-master.

This ensures that:

  • database contents can be restored in case of failure

  • historical backups are retained

  • backup and retention are fully automated

  • manual backup and restore are available when needed

Automatic Backup

VISULOX performs a full PostgreSQL database dump:

  • Every day at 08:34 AM

  • Backup files are stored in:

/var/visulox-portal/dbs/backups

Each backup contains a complete snapshot of the database.

Backup Retention Policy

VISULOX automatically removes old backups.

Retention policy:

  • Backups older than 30 days are deleted automatically

Backup Location

Backup directory:

/var/visulox-portal/dbs/backups

List backups:

ls -lh /var/visulox-portal/dbs/backups

Example:

-rw-r--r-- 1 vlx vlxgroup 45M Feb 12 08:34 visulox_backup_2026-02-12.sql
-rw-r--r-- 1 vlx vlxgroup 46M Feb 13 08:34 visulox_backup_2026-02-13.sql

Manual Backup

Manual backups can be created at any time.

Step 1 - Run backup inside backup container

sudo vlx-docker exec vlx-db-backup /usr/local/bin/backup.sh

This will create a new backup file in:

/var/visulox-portal/dbs/backups

Step 2 - Verify backup was created

ls -lh /var/visulox-portal/dbs/backups

You should see a new backup file with the current date and time.

Manual Restore

Use this procedure to restore the database from a backup file.

warning WARNING: This will overwrite the current database.

Step 1 - Stop Portal and Connector services

sudo systemctl stop vlx-portal
sudo systemctl stop vlx-connector

Step 2 - Restore database from backup

Run restore inside the PostgreSQL container:

sudo vlx-docker exec -i vlx-postgres psql -U postgres -d visulox < /var/visulox-portal/dbs/backups/<backup-file>.sql

Example:

sudo vlx-docker exec -i vlx-postgres psql -U postgres -d visulox < /var/visulox-portal/dbs/backups/visulox_backup_2026-02-13.sql

Step 3 - Restart services

sudo systemctl start vlx-portal
sudo systemctl start vlx-connector

Step 4 - Verify system status

Check portal service:

sudo systemctl status vlx-portal

Check connector service:

sudo systemctl status vlx-connector

Check logs:

tail -f /var/log/visulox-portal/portal.log

Verify Backup System

Check backup container:

sudo vlx-docker ps | grep vlx-db-backup

Check backup schedule:

sudo vlx-docker exec vlx-db-backup crontab -l

Expected output:

34 8 * * * /usr/local/bin/backup.sh

Troubleshooting

Check backup container logs:

sudo vlx-docker logs vlx-db-backup

Check PostgreSQL container:

sudo vlx-docker ps | grep postgres

Check backup directory:

ls -ld /var/visulox-portal/dbs/backups

Expected owner:

vlx:vlxgroup