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:
.env
File: This file contains environment variables and configurations for your IPMonitor application.license.dat
File: This file contains your IPMonitor license information.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
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
- Start by accessing the MySQL container using this command:
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:bashmysqldump -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE > backup.sql
mysqldump -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE > backup.sql
- Run the
Copy the Backup File:
- Finally, copy the
backup.sql
file to your application folder:bashsudo -E docker cp ipmonitor-mysql-1:backup.sql /opt/ipmonitor/
sudo -E docker cp ipmonitor-mysql-1:backup.sql /opt/ipmonitor/
- Finally, copy the
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.