Database Backup Guide

Audience: Administrators Difficulty: Intermediate Estimated Time: 15 minutes

Overview

The TrafficPOS system features a comprehensive database backup system that stores ALL operational data in a single encrypted JSON file. This is a complete database backup solution, not just a data export, ensuring full business continuity and disaster recovery capabilities.

Critical Business Protection: Regular database backups are essential for protecting your dispensary's operational data and ensuring business continuity.

Complete Backup Coverage

Core Business Data

  • Products: All inventory items with current stock levels
  • Sales: Complete transaction history
  • Customers: Customer database with purchase history
  • Employees: All employee records with encrypted credentials
  • Time Tracking: Complete time clock records

System Configuration

  • Business Information: Name, address, contact details
  • POS Settings: All system preferences and configurations
  • Categories: Product categories and organization
  • Tax Settings: Current tax rates and rules
  • User Accounts: System users and permissions

Operational Records

  • Drivers: Delivery driver records and performance
  • Store Sessions: Till open/close history
  • Inventory Counts: Stock count records and variances
  • App Configuration: Mode settings and backup preferences
  • Audit Trails: Complete activity logs

Security Features

  • AES-256 Encryption: Secure credential protection
  • Password Protection: Encrypted backup files
  • Data Integrity: Verification and validation
  • Access Control: Admin-only backup functions
  • Audit Logging: Backup and restore tracking

Creating a Complete Database Backup

1

Access Backup System

Navigate to Settings → Data Management → Export All Data

  • Ensure you have administrator privileges
  • Verify all pending transactions are completed
  • Check that no other users are actively using the system
2

Configure Backup Security

  • Enter Encryption Password: Choose a strong, memorable password
  • Confirm Password: Re-enter to verify accuracy
  • Record Password Securely: Store in password manager or secure location
  • Note: This password is required for restoration
3

Generate and Save Backup

  • Click "Create Backup" to generate the file
  • Use descriptive filename: trafficpos-backup-YYYY-MM-DD.json
  • Save to secure location (external drive, cloud storage)
  • Verify file size is reasonable (contains all data)
  • Test backup integrity by opening file briefly

Backup File Naming Convention

Recommended Naming Patterns

  • Daily: trafficpos-daily-2025-01-15.json
  • Weekly: trafficpos-weekly-2025-W03.json
  • Monthly: trafficpos-monthly-2025-01.json
  • Before Updates: trafficpos-pre-update-v2.1.json
  • Emergency: trafficpos-emergency-backup.json

Restoring from Database Backup

Pre-Restoration Checklist

IMPORTANT: Importing a backup REPLACES ALL existing data. Current data will be permanently lost.
  • Export Current Data: Create backup of existing data first
  • Verify Backup File: Ensure backup file is complete and uncorrupted
  • Have Decryption Password: The password used when creating backup
  • Notify Staff: Inform team of temporary system unavailability

Restoration Methods

Method 1: From Login Screen (Complete System Reset)

  • On the login screen, click "Restore from Backup"
  • Select your backup JSON file
  • Enter the decryption password
  • Wait for complete restoration process
  • System will restart with restored data

Method 2: From Settings (Administrative Restore)

  • Navigate to Settings → Data Management
  • Click "Import Full Backup"
  • Select backup file from storage
  • Enter the decryption password
  • Confirm restoration operation
  • Monitor restoration progress

Automatic Backup System

Configure Automated Backups

Navigate to Settings → Automated Backups

  • Enable Automatic Backups: Toggle on automated system
  • Set Frequency: Hourly, daily, or every 2 days
  • Storage Location: Local browser storage (default)
  • Retention Policy: Number of backups to keep
  • Encryption Password: Default password for automated backups

Automatic Backup Schedule Recommendations

Business Size Transaction Volume Recommended Frequency Storage Strategy
Small Dispensary < 50 transactions/day Daily Local + weekly manual backup
Medium Dispensary 50-200 transactions/day Every 12 hours Local + daily manual backup
Large Dispensary 200+ transactions/day Every 6 hours Local + automated cloud sync
Multi-Location High volume Every 2 hours Centralized backup system

Security and Encryption

Encryption Details

  • Algorithm: AES-256-GCM encryption
  • Key Derivation: PBKDF2 with 100,000 iterations
  • Salt Generation: Cryptographically secure random salt
  • Data Integrity: Built-in authentication and verification

Protected Data

  • Employee PINs: Encrypted in backup file
  • User Passwords: Hashed and encrypted
  • Sensitive Settings: Encrypted configuration data
  • Customer Data: Privacy-protected information

Password Management Critical Points

  • Remember Backup Password: Required for credential restoration
  • Without Password: Employees will need new PINs assigned
  • Store Securely: Use password manager or secure documentation
  • Regular Updates: Consider periodic password changes

Emergency Recovery Procedures

Default System Credentials

Emergency Access Credentials

If starting fresh or after database corruption:

Role Email Password Default PIN
Admin admin@dispensary.com admin123 1234
Manager manager@dispensary.com manager123 1234
Budtender budtender@dispensary.com budtender123 1234
Security Note: Change these default credentials immediately after system restoration.

Database Storage Architecture

Storage Mechanisms

  • IndexedDB (Primary): All critical business data and transactions
  • LocalStorage (Secondary): Session data and temporary preferences
  • Backup Coverage: Complete IndexedDB data included in backups
  • Session Data: Rebuilt automatically on login

Troubleshooting Common Issues

Backup Creation Problems

Backup Process Fails

  1. Check available disk space for backup file
  2. Ensure no other processes are accessing database
  3. Close other browser tabs/windows
  4. Try creating backup during low-activity period
  5. Clear browser cache and try again

Backup File Too Large

  • Backups include complete sales history
  • Consider archiving old sales data before backup
  • Use file compression for long-term storage
  • Implement tiered backup strategy (daily vs. complete)

Restoration Problems

Can't Login After Restore

  1. Verify correct backup password was entered
  2. Try default credentials listed above
  3. Check browser console for decryption errors
  4. Attempt restoration with different backup file
  5. Clear browser data and restart restoration

Missing Data After Restore

  • Verify backup file integrity (not truncated/corrupted)
  • Check browser console for import errors
  • Ensure correct backup file was selected
  • Try importing with correct decryption password
  • Verify backup was created with same system version

Password Recovery Issues

Forgotten Backup Password

  • No Recovery Method: Password cannot be recovered
  • Alternative: Use backup without employee credentials
  • Manual Setup: Reassign all employee PINs and passwords
  • Prevention: Use password manager for future backups

Best Practices

Backup Schedule

  • Daily Backups: End-of-day backup routine
  • Weekly Archives: Long-term storage backups
  • Pre-Update Backups: Before system updates
  • Monthly Full Backups: Complete system snapshots

Storage Strategy

  • Multiple Locations: Local, cloud, and external storage
  • Rotation Policy: Keep multiple backup versions
  • Geographic Distribution: Off-site backup copies
  • Access Control: Secure backup file storage

Security Measures

  • Strong Passwords: Complex backup encryption passwords
  • Regular Testing: Periodic restoration tests
  • Access Logging: Track backup/restore activities
  • Staff Training: Backup procedure training

Documentation

  • Backup Logs: Record backup creation dates
  • Password Documentation: Secure password storage
  • Recovery Procedures: Step-by-step restoration guide
  • Emergency Contacts: IT support information

Related Guides

User Backup Guide

Simplified backup procedures for daily staff use

Security Guide

Comprehensive security measures and data protection

Deployment Guide

System setup and initial configuration procedures