This document provides instructions for backing up and restoring your Atlas CMMS system using the provided utility scripts. The utilities are available for both Windows and Linux operating systems.
- Docker and Docker Compose installed and running
- Atlas CMMS system up and running
- Administrative access to your system
- Save the atlas-backup.ps1 script to your Atlas CMMS project directory
- Open PowerShell as Administrator
- Navigate to your Atlas CMMS project directory:
cd C:\path\to\your\atlas\project
- Ensure script execution is allowed:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
To create a complete backup of your Atlas CMMS system:
.\atlas-backup.ps1 backupThe script will:
- Check if Docker is running
- Back up the PostgreSQL database
- Back up the MinIO file storage
- Create a ZIP archive in the
atlas_backupsdirectory
To skip backing up the database:
.\atlas-backup.ps1 backup -SkipDbTo skip backing up the files:
.\atlas-backup.ps1 backup -SkipFilesEnsure the backend container is stopped. To restore your Atlas CMMS system from a backup:
.\atlas-backup.ps1 restore .\atlas_backups\atlas_backup_YYYYMMDD_HHMMSS.zipReplace YYYYMMDD_HHMMSS with the timestamp of your backup file.
To skip restoring the database:
.\atlas-backup.ps1 restore .\atlas_backups\atlas_backup_YYYYMMDD_HHMMSS.zip -SkipDbTo skip restoring the files:
.\atlas-backup.ps1 restore .\atlas_backups\atlas_backup_YYYYMMDD_HHMMSS.zip -SkipFiles- Save the atlas-backup.sh script to your Atlas CMMS project directory
- Open a terminal
- Navigate to your Atlas CMMS project directory:
cd /path/to/your/atlas/project - Make the script executable:
chmod +x atlas-backup.sh
To create a complete backup of your Atlas CMMS system:
./atlas-backup.sh backupThe script will:
- Check if Docker is running
- Back up the PostgresSQL database
- Back up the MinIO file storage
- Create a tar.gz archive in the
atlas_backupsdirectory
To skip backing up the database:
./atlas-backup.sh backup --skip-dbTo skip backing up the files:
./atlas-backup.sh backup --skip-filesEnsure the backend container is stopped. To restore your Atlas CMMS system from a backup:
./atlas-backup.sh restore ./atlas_backups/atlas_backup_YYYYMMDD_HHMMSS.tar.gzReplace YYYYMMDD_HHMMSS with the timestamp of your backup file.
To skip restoring the database:
./atlas-backup.sh restore ./atlas_backups/atlas_backup_YYYYMMDD_HHMMSS.tar.gz --skip-dbTo skip restoring the files:
./atlas-backup.sh restore ./atlas_backups/atlas_backup_YYYYMMDD_HHMMSS.tar.gz --skip-filesBoth scripts automatically read credentials from a .env file in the same directory. If your Atlas CMMS uses custom credentials, make sure your .env file contains the following variables:
POSTGRES_USER=your_postgres_username
POSTGRES_PWD=your_postgres_password
MINIO_USER=your_minio_username
MINIO_PASSWORD=your_minio_password
If the .env file is not present, the scripts will use default credentials:
-
Database Restoration: When restoring a database, the script renames your current database to
atlas_oldbefore creating a newatlasdatabase with the backup data. This allows for recovery if the restore process fails. -
Confirmation Prompts: The restore operation will prompt for confirmation before overwriting your database or files.
-
Backup Directory: All backups are stored in an
atlas_backupsdirectory created in the same location as the script. -
Network Configuration: The scripts assume your Docker Compose network is named
atlas-cmms_default. If your setup uses a different network name, you'll need to modify the scripts accordingly.
If you receive an error about Docker not running, ensure Docker Desktop (Windows) or Docker service (Linux) is started:
- Windows: Open Docker Desktop application
- Linux: Run
sudo systemctl start docker
If you see errors about containers not being found, ensure your Atlas CMMS environment is running:
docker-compose ps # Check if containers are running
docker-compose up -d # Start containers if neededIf you encounter permission errors on Linux, make sure the script is executable:
chmod +x atlas-backup.shIf the script cannot connect to containers, verify your Docker network configuration:
docker network lsIf your Atlas CMMS network is not named atlas-cmms_default, you'll need to update the network name in the scripts.