GLPI Update

Upgrade procedure - BTS SIO SISR

Objective

Update GLPI to a newer version while preserving data, configuration and plugins. Safe procedure with prior backups.

Prerequisites

WARNING: NEVER update in production without prior testing and a full backup!

Full Procedure

Step 1: Check the current version

cat /var/www/html/glpi/version.txt

Or via the interface: Configuration → General → Overview

Step 2: Enable maintenance mode

Configuration → General → System

This prevents users from logging in during the update.

Step 3: Full backup

A. Backup GLPI files

mkdir -p /root/backup_glpi
cp -r /var/www/html/glpi /root/backup_glpi/glpi_$(date +%Y%m%d)

B. Database backup

mysqldump -u root -p glpi > /root/backup_glpi/glpi_$(date +%Y%m%d).sql

C. Verify backups

ls -lh /root/backup_glpi/
Backups created: You should see the glpi_YYYYMMDD folder and the .sql file

Step 4: Download the new version

cd /tmp
wget https://github.com/glpi-project/glpi/releases/download/10.0.17/glpi-10.0.17.tgz
Note: Replace 10.0.17 with the desired version. See: GitHub GLPI Releases

Step 5: Extract and replace

# Extract
tar -xzf glpi-10.0.17.tgz

# Remove old version (except config and files)
rm -rf /var/www/html/glpi/*

# Copy new version
cp -r /tmp/glpi/* /var/www/html/glpi/

# Restore configuration
cp -r /root/backup_glpi/glpi_*/config/* /var/www/html/glpi/config/
cp -r /root/backup_glpi/glpi_*/files/* /var/www/html/glpi/files/
cp -r /root/backup_glpi/glpi_*/plugins/* /var/www/html/glpi/plugins/

# Permissions
chown -R www-data:www-data /var/www/html/glpi
chmod -R 755 /var/www/html/glpi

Step 6: Update the database

Access the web interface: http://SERVER_IP/glpi

GLPI automatically detects that the database needs updating and displays the migration wizard.

  1. Log in with an administrator account
  2. Follow the update wizard
  3. Click "Continue" at each step
  4. Wait for the database migration to complete (may take several minutes)
Update successful: The message "Database update is complete" is displayed

Step 7: Disable maintenance mode

Configuration → General → System

Step 8: Update plugins

Configuration → Plugins

Post-Migration Verification

Version check

Configuration → General → Overview: verify the version number

Functional tests

Log verification

tail -f /var/log/apache2/glpi_error.log
tail -f /var/www/html/glpi/files/_log/php-errors.log

Rollback Procedure (in case of problems)

Restore files

rm -rf /var/www/html/glpi
cp -r /root/backup_glpi/glpi_20241215 /var/www/html/glpi
chown -R www-data:www-data /var/www/html/glpi

Restore the database

mysql -u root -p

DROP DATABASE glpi;
CREATE DATABASE glpi CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
EXIT;

mysql -u root -p glpi < /root/backup_glpi/glpi_20241215.sql

Security and Best Practices

Troubleshooting

Problem: Blank page after update

# Check PHP logs
tail -f /var/www/html/glpi/files/_log/php-errors.log

# Clear the cache
rm -rf /var/www/html/glpi/files/_cache/*

Problem: Database error

Problem: Incompatible plugin

Temporarily disable the plugin:

mv /var/www/html/glpi/plugins/plugin_name /var/www/html/glpi/plugins/plugin_name.disabled

Key Points for the BTS Oral