Skip to content

Backing Up IPMonitor

Regular backups are essential for maintaining the integrity and safety of your IPMonitor application data. This guide explains the simple process of backing up critical files for IPMonitor.

Files to Back Up

You only need to back up three key files:

  1. .env File: This file contains environment variables and configurations for your IPMonitor application.
  2. license.dat File: This file contains your IPMonitor license information.
  3. backup.sql File: This is the database backup file, which is created during the backup process.

All these files are located in the application folder: /opt/ipmonitor/.

Steps for Database Backup

  1. Access the MySQL Container:

    • Start by accessing the MySQL container using this command:
      bash
      sudo -E docker compose exec mysql bash
      sudo -E docker compose exec mysql bash
  2. Create Database Dump:

    • Run the mysqldump command to create a backup of your database. $MYSQL_USER, $MYSQL_PASSWORD, and $MYSQL_DATABASE are environment variables. Keep them as it is:
      bash
      mysqldump -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE > backup.sql
      mysqldump -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE > backup.sql
  3. Copy the Backup File:

    • Finally, copy the backup.sql file to your application folder:
      bash
      sudo -E docker cp ipmonitor-mysql-1:backup.sql /opt/ipmonitor/
      sudo -E docker cp ipmonitor-mysql-1:backup.sql /opt/ipmonitor/

Reinstallation and File Restoration

In case of data loss or when setting up IPMonitor on a new server, you can restore your application using the backup files. Simply reinstall IPMonitor and replace the .env, license.dat, and backup.sql files in the application folder with your backed-up files.

Conclusion

Backing up these three critical files ensures that you can quickly recover your IPMonitor application in case of data loss or when migrating to a new server. Regular backups contribute significantly to the resilience and stability of your application.