AIV Standalone Backup and Restore Guide (Windows & Linux)
This guide provides step-by-step instructions for end users to backup and restore their Active Intelligence (AIV) standalone JAR installation on both Windows and Linux environments.
The AIV backup system runs as a parallel background process, ensuring that your dashboard data, uploaded reports, and system settings are fully protected without interrupting your running AIV application.
1. Prerequisites
Before running backup or restore operations, ensure:
- PostgreSQL Client Utilities (
pg_dumpandpg_restore) are installed on the host and available in your shellPATH. - The system is running AIV Standalone via
aiv.bat(Windows) oraiv.sh(Linux). - You have write access to the AIV directory.
- (Linux only): Make sure the script files have execution permissions. Run this once inside
backup-standaloneto be safe:chmod +x *.sh
Step 1: Initial Configuration
Before running backups for the first time, you must verify that the backup settings match your database configuration.
- Navigate to the
backup-standalonefolder:- Windows:
cd C:\aiv\backup-standalone(or your extracted standalone location) - Linux:
cd /home/username/aiv/backup-standalone(or your extracted standalone location)
- Windows:
- Open the
backup.conffile in a text editor. - Verify and update the following settings:
PGDATABASE: Must match the database name in AIV’s active configuration (aivby default).PGPASSWORD: Must match your PostgreSQL database password.REPO_PATH: Full path or relative path to the activerepositoryfolder.BACKUP_ROOT: Full path or relative path to where you want to store your backup files.MAX_BACKUPS: The number of historical backups you wish to retain (e.g.,24).
Example configuration (backup.conf):
PGHOST=localhost
PGPORT=5432
PGUSER=postgres
PGDATABASE=aiv
PGPASSWORD=root
# Windows Settings (Default)
# Uses relative paths assuming backup-standalone is inside your main AIV folder
REPO_PATH=..\repository
BACKUP_ROOT=..\backups
# Linux Settings (Comment Windows paths and uncomment these on Linux)
# REPO_PATH=../repository
# BACKUP_ROOT=../backups
MAX_BACKUPS=24
BACKUP_INTERVAL=3600
Step 2: Taking a One-Time Manual Backup
If you are about to perform maintenance, upgrades, or want to take an instant snapshot of your work:
Windows
- Open Command Prompt (cmd) and navigate to your standalone folder.
- Run:
backup.bat
Linux
- Open your terminal and navigate to your standalone folder.
- Run:
./backup.sh
Once completed, a new folder will be created inside your backups directory named with the current timestamp (e.g., 2026-05-25_100106) containing db.dump (database dump) and repo.tar.gz (repository files).
Step 3: Scheduling Automated Hourly Backups
To keep your AIV files and database backed up every hour automatically in the background:
Windows
- Open Command Prompt (cmd) and navigate to the standalone folder.
- Start the hourly scheduler:
(This launches a minimized background window titled “AIV Backup Scheduler” that handles the hourly timer.)start_scheduler.bat - To stop automated backups:
stop_scheduler.bat
Linux
- Open your terminal and navigate to the standalone folder.
- Start the hourly scheduler in the background:
(This starts the scheduler process in the background using./start_scheduler.shnohupand saves the process ID insidescheduler.pid.) - To stop automated backups:
./stop.sh
Step 4: Restoring from a Backup
[!WARNING] Restoring a backup will overwrite your current PostgreSQL database and AIV repository folder. Always make sure to take a manual backup beforehand just in case.
Windows
- Open Command Prompt (cmd) and navigate to your standalone folder.
- Run:
restore.bat - Enter the desired timestamp when prompted (e.g.,
2026-05-25_100106) and press Enter. - Type
yto confirm the overwrite warning.
Linux
- Open your terminal and navigate to your standalone folder.
- Run:
./restore.sh - Enter the desired timestamp when prompted and press Enter.
- Type
yto confirm.
Important Final Step (Both Platforms)
Once the restore finishes successfully, restart the AIV application (aiv.bat on Windows or aiv.sh on Linux) so the Java server clears its memory cache and reads the newly restored database records!
Troubleshooting & Best Practices
- Files are missing in the UI after restore: Make sure you restarted the AIV application after running the restore. AIV caches database structures in Java memory and requires a fresh start to sync properly with the newly restored database.
- Backup script fails to find pg_dump or pg_restore:
Ensure PostgreSQL client tools are installed and in your system’s
PATHvariables. - Scheduler is not running:
- Windows: If the scheduler fails to start, verify if
scheduler.lockexists in your folder. If it does, delete it manually and re-runstart_scheduler.bat. - Linux: Check
scheduler.login the folder to see why the process stopped or didn’t launch.
- Windows: If the scheduler fails to start, verify if