GLPI, also known as Gestionnaire de parc informatique, is an open-source IT asset management software that helps businesses manage their IT assets, including software, hardware, and network components. However, as with any software, it’s essential to have a reliable backup plan in place to protect your data in case of system failures or other unforeseen events. In this blog post, we’ll discuss the steps involved in backing up GLPI software, including the files and config folders and any customized plugin folders and files, as well as the GLPI database in Mariadb.

Step 1: Backing up GLPI software files and config folders

The first step in backing up GLPI software is to backup the files and config folders. These folders contain the core files and configurations of the software, including the templates, language files, and other important information. To backup these folders, you can use the command-line tool “cp” to copy the files and folders to a safe location. For example, if your GLPI installation is located in /var/www/glpi, you can use the following command to backup the files and config folders:

cp -R /var/www/glpi /backup/glpi

This command will copy the entire GLPI installation to the /backup/glpi directory, preserving the file and folder structure.

Step 2: Backing up customized plugin folders and files

If you have customized any of the GLPI plugin folders and files, it’s essential to back them up as well. Customized plugin folders and files are usually located in the /plugins directory of the GLPI installation. To backup these folders and files, you can use the same command as in step 1, but with the location of the plugin folders and files. For example, if you have customized the inventory plugin and it is located in /var/www/glpi/plugins/inventory, you can use the following command to backup the plugin:

cp -R /var/www/glpi/plugins/inventory /backup/glpi/plugins

Step 3: Backing up GLPI database in Mariadb

The final step in backing up GLPI is to backup the database. GLPI uses Mariadb, a popular open-source relational database management system. To backup the GLPI database, you can use the “mysqldump” command-line tool. This tool is used to create a backup of the entire database or specific tables. For example, to backup the entire GLPI database, you can use the following command:

mysqldump -u [username] -p [password] [database_name] > /backup/glpi_database.sql

Where [username] and [password] are the username and password of the MariaDB user with access to the GLPI database, and [database_name] is the name of the GLPI database.

Note: The above command will create a file called “glpi_database.sql” in the /backup directory. This file contains the SQL commands necessary to recreate the GLPI database.

Conclusion

Backing up GLPI software, including the files and config folders, any customized plugin folders and files, and the GLPI database in Mariadb is crucial to ensure that your IT assets are protected in case of system failures or other unforeseen events. By following the steps outlined in this blog post, you can create a reliable backup plan that will help you quickly restore your data if needed. Remember, always make sure to test your backup and restore procedures regularly to ensure that they are working correctly and that your data is being backed up properly.

Additionally, it’s also a good idea to schedule regular backups to occur automatically. This can be done by creating a cron job that runs the backup commands at a specific time. For example, you can schedule a cron job to run the backup commands every day at midnight.

It’s also important to consider storing your backups in a secure and offsite location. This can be done by using a cloud-based storage solution, such as Amazon S3 or Google Drive, or by storing them on an external hard drive that is kept in a different location. This way, if your primary location experiences a disaster, your backups will still be safe and accessible.

In summary, backing up GLPI software and its database is an important part of maintaining your IT assets. By following the steps outlined in this blog post, you can create a reliable backup plan that will help you protect your data and quickly restore it if needed. Remember, always test your backup and restore procedures regularly, schedule regular backups, and store your backups in a secure and offsite location.