Backup GLPI

After installing GLPI and running through the initial configuration steps next installation step is to back up GLPI so that it can be restored if anything goes wrong while you are setting up GLPI.

Create Backup Folder

Before we start making backups it makes sense to create folders to keep our backup files in so that they can be found easily. I like to create a folder called backup in the root (/) directory and then create 2 sub-folders called mysql (for the GLPI backups) and www (for the GLPI web directory):

This structure is even more useful when setting up automated backups once GLPI is fully setup and being used in production.

The process of backing up GLPI is really simple and involves 2 steps:

1. Backup the GLPI database

To back up the database MySQL dump can be used by running the following command:

mysqldump -u root -p <glpi_database> > ~/glpi-sqldump.sql

2. Backup the GLPI folder

Once the database is backed up the GLPI folder in /var/www/html/ needs to be backed up and compressed. The easiest way to do this is to use tar to compress the folder and copy it to the folder that you want it copied to. This can be done by running the following command:

tar -czvf /location_to_save_backup/backup_name.tar.gz /var/www/html/glpi

Once these two things are backup up you will have all the data that you need to restore glpi to the server’s current state.

1 thought on “Backup GLPI”

  1. Pingback: Install GLPI on Ubuntu 22.04 - GLPI How Too

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top