Skip to content
tomolimo edited this page Sep 28, 2016 · 4 revisions

1 - Mysql DB time_zone tables (master + slave) (don't forget to restart mysql). See mySQL time zone tables

2 - Grant 'SELECT' privilege to GLPI database user to

Table 'time_zone_name' in database 'mysql'

Could be done like:

GRANT SELECT ON `mysql`.`time_zone_name` TO 'glpi'@'localhost' ; 

NOTE: 'localhost' should be replaced by the GLPI server name if not localhost.

This privilege is used by plugin to get the list of MySQL available time zones. This list is compared to the PHP time zone list to get intersection, which will be the list shown to end-users.

Table 'COLUMNS' in database 'INFORMATION_SCHEMA'

Could be done like:

GRANT SELECT ON `INFORMATION_SCHEMA`.`COLUMNS` TO 'glpi'@'localhost' ; 

NOTE: 'localhost' should be replaced by the GLPI server name if not localhost.

This privilege is used by plugin to prevent activation in case some fields have not been converted from DATETIME to TIMESTAMP type.

3 - PHP timezonedb settings. See PHP timezonedb

4 - Copy 'Timezones' plugin folder into the 'plugins' folder of GLPI (like for any other plugin)

5 - Go to GLPI plugin page and install 'Timezones'

6 - If needed, stop any scheduled tasks on server (OCS, LDAP, cron, backup,...)

7 - To prevent any loss of data: backup GLPI DB

8 - Execute dbupdate.php script:

NOTE: before upgrade of GLPI DB: verify that the default time zone is correctly defined in your php.ini, example:

date.timezone = Europe/Paris
It must match the default time zone of MySQL server (which usually matches server's one).
  1. start a console on GLPI server (must be executed by an administrator on server)
  2. go to directory: glpi_path/plugins/timezones/scripts
  3. execute following command: php -f dbupdate.php (this will modify the DATETIME fields of GLPI DB into TIMESTAMP fields) (This script will consider that all current DATETIME values are expressed in MySQL server default time zone).
  4. if errors appear you may fix them and restart the script. The script will not try to convert already converted fields.

9 - Go to GLPI plugin page and enable 'Timezones' plugin. You may need to reload (or refresh) the page to be able to enable it.