Skip to main content

Backup Procedure

Safeguard your ServiceOps environment and ensure business continuity by implementing robust application and database backup procedures.

Effective application and database backup procedures are critical for ensuring business continuity, data integrity, and security in ServiceOps environments. This guide provides comprehensive procedures for backing up both the ServiceOps application components and the PostgreSQL database to safeguard against data loss, corruption, and system failures.

Regular backups enable quick recovery and minimize downtime in case of disasters, system upgrades, or migration scenarios. ServiceOps supports both manual backup procedures and automated scheduled backups through the application interface.

Prerequisites

Before performing backup procedures, ensure you have:

  • Administrative access to the ServiceOps server
  • Sufficient disk space for backup storage (typically 2-3x the current application size)
  • Network access to backup storage locations (if using remote storage)
  • Service status knowledge - verify which components are currently running

Application Backup

The ServiceOps application backup includes all critical components, configuration files, and data directories. Follow these steps to create a complete application backup:

View Step-by-Step Instructions for Application Backup

Step 1: Prepare Backup Environment

  1. Login to the ServiceOps server via SSH or terminal access

  2. Navigate to the home directory:

    cd /home/motadata
  3. Create a backup directory with current date:

    Syntax: mkdir backupApp_DD-MM-YYYY

    Example: mkdir backupApp_12-03-2025

  4. Navigate to the backup directory:

    Syntax: cd backupApp_DD-MM-YYYY/

    Example: cd backupApp_12-03-2025

Step 2: Create Component Directories

Create sub-directories under the “backupApp_12-03-2025” directory for the different servers and components as shown below:

mkdir main-server
mkdir analytics-server
mkdir fileserver
mkdir chat_server
mkdir plugin-server
mkdir discovery-service
mkdir otherfiles

Step 3: Backup Main Server

The main server contains core application logic, configurations, and data:

  1. Navigate to main server directory:

    cd main-server
  2. Copy critical directories:

    cp -pr /opt/flotomate/main-server/lib .
    cp -pr /opt/flotomate/main-server/dbs .
    cp -pr /opt/flotomate/main-server/config .
    cp -pr /opt/flotomate/main-server/filedb .
    cp -pr /opt/flotomate/main-server/elastic .

Step 4: Backup Analytics Server

  1. Navigate to analytics server directory:

    cd ../analytics-server
  2. Copy analytics components:

    cp -pr /opt/flotomate/cm-analytics/lib .
    cp -pr /opt/flotomate/cm-analytics/config .
    cp -pr /opt/flotomate/cm-analytics/filedb .

Step 5: Backup File Server

  1. Navigate to file server directory:

    cd ../fileserver
  2. Copy file server components:

    cp -pr /opt/flotomate/fileserver/lib .
    cp -pr /opt/flotomate/fileserver/config .

Step 6: Backup Chat Server

  1. Navigate to chat server directory:

    cd ../chat_server
  2. Copy chat server files:

    cp -pr /opt/flotomate/chat_server/*.* .

Step 7: Backup Plugin Server

  1. Navigate to plugin server directory:

    cd ../plugin-server
  2. Copy plugin server directory:

    cp -pr /opt/flotomate/plugin-server/ .

Step 8: Backup Discovery Service

  1. Navigate to discovery service directory:

    cd ../discovery-service
  2. Copy discovery service components:

    cp -pr /opt/flotomate/discovery/discovery .
    cp -pr /opt/flotomate/discovery/pattern-executor .
    cp -pr /opt/flotomate/discovery/app.config .

Step 9: Backup System Files

  1. Navigate to other files directory:

    cd ../otherfiles
  2. Copy frontend application:

    cp -pr /opt/flotomate/frontend .
  3. Copy Nginx configuration:

    cp -pr /etc/nginx .
  4. Copy SSL certificates and keys:

    cp -pr /etc/ssl .
  5. Copy PostgreSQL configuration:

    cp -pr /etc/postgresql .
  6. Copy PostgreSQL data files:

    cp -pr /var/lib/postgresql/16/main .

Database Backup

The PostgreSQL database contains all ServiceOps data including incidents, changes, assets, and configurations. Follow these steps for database backup:

View Step-by-Step Instructions for Database Backup

Step 1: Prepare Database Backup

  1. Navigate to home directory:

    cd /home/motadata
  2. Create database backup directory:

    Syntax: mkdir backupDB_DD-MM-YYYY

    Example: mkdir backupDB_12-03-2025

  3. Navigate to temporary directory:

    cd /tmp

Step 2: Create Database Dump

Execute the PostgreSQL dump command to create a complete database backup:

sudo -u postgres pg_dump -U postgres -d flotoitsmdb -F c -b -v -f /tmp/flotoitsmdb_dump -d flotoitsmdb

Command Parameters Explained:

  • -U postgres: Use postgres user
  • -d flotoitsmdb: Target database name
  • -F c: Custom format (compressed)
  • -b: Include large objects
  • -v: Verbose output
  • -f /tmp/flotoitsmdb_dump: Output file location

Step 3: Move Database Backup

Copy the database dump to the backup directory:

cp flotoitsmdb_dump /home/motadata/backupDB_DD-MM-YYYY

Step 4: Backup PostgreSQL Data Directory (Optional)

For additional safety, backup the PostgreSQL data directory:

For Ubuntu OS:

cd /var/lib/postgresql/16
cp -r main /home/motadata/backupDB_DD-MM-YYYY

For RedHat OS:

cd /var/lib/pgsql/16
cp -r data /home/motadata/backupDB_DD-MM-YYYY

Automated Backup Configuration

ServiceOps provides automated backup scheduling through the application interface:

View Instructions for Automated Backup Configuration

Configure Automated Database Backup

  1. Login to the ServiceOps application.
  2. Navigate to Admin > Organization > Application Maintenance menu and click on the Database Backup tab.

  1. Configure Database Backup Settings to export the database backup to a specific FTP location (FTP applies only to Linux machines).

  • Configure FTP Settings (for Linux machines):
    • Host: Enter FTP server hostname
    • Username: FTP server username
    • Password: FTP server password
    • Folder Path: Backup storage location
    • Test Connection: Verify FTP connectivity
  • Set Backup Retention: Configure number of backups to retain (5-99, default: 10)
  • Once done, click Update.
  1. Schedule Database Backup: Set the database backup schedule as daily. Also, specify the date and time when the schedule should start in the Start At field. Additionally, specify the Time at which the schedule should run.

  2. Test the Backup Process by clicking on Backup Now. Upon successful backup process completion, a history record will be created and displayed on the database backup listing page.

Backup Verification

View Backup Verification Steps

After completing backup procedures, verify the backup integrity:

Verify Application Backup

  1. Check backup directory structure:

    ls -la /home/motadata/backupApp_DD-MM-YYYY/
  2. Verify critical files exist:

    • Main server configuration files
    • Database configuration
    • SSL certificates
    • Nginx configuration

Verify Database Backup

  1. Check database dump file:

    ls -la /home/motadata/backupDB_DD-MM-YYYY/flotoitsmdb_dump
  2. Verify dump file integrity:

    pg_restore --list /home/motadata/backupDB_DD-MM-YYYY/flotoitsmdb_dump | head -10

Backup Storage Best Practices

View Backup Storage Best Practices

Local Storage

  • Store backups on separate physical disks
  • Use RAID configurations for redundancy
  • Implement regular backup rotation

Remote Storage

  • Use secure FTP/SFTP for remote backup
  • Implement encryption for sensitive data
  • Test restore procedures regularly

Backup Retention

  • Daily backups: Retain for 7 days
  • Weekly backups: Retain for 4 weeks
  • Monthly backups: Retain for 12 months
  • Yearly backups: Retain for 7 years

Troubleshooting

View Common Issues and Troubleshooting Steps

Common Backup Issues

Insufficient Disk Space:

df -h
du -sh /home/motadata/backupApp_DD-MM-YYYY/

Permission Denied Errors:

sudo chown -R motadata:motadata /home/motadata/backupApp_DD-MM-YYYY/

Database Connection Issues:

sudo systemctl status postgresql
sudo -u postgres psql -c "\l"

Backup Size Optimization

  • Exclude unnecessary files: Skip log files and temporary data
  • Compress backups: Use gzip or tar compression
  • Incremental backups: Consider differential backup strategies

Next Steps

After completing the backup procedure:

  1. Document backup details: Record backup date, size, and location
  2. Test restore procedures: Verify backup integrity through restore testing
  3. Schedule regular backups: Implement automated backup scheduling
  4. Monitor backup success: Set up alerts for backup failures
  5. Review backup strategy: Periodically assess and update backup procedures