For the complete documentation index, see llms.txt. This page is also available as Markdown.

Export local database and files

Database

Once connected in CLI on your server hosting your database, run the following commands:

mysqldump -u myuser -p  myglpibase > mydump.sql
tar -czf mydump.sql.tar.gz mydump.sql

Files

Perform an archive of the files folder using the command below (keeping the exclusion of the mentioned folders):

tar --exclude="_cache" --exclude="_cron" --exclude="_dumps" --exclude="_graphs" --exclude="_lock" --exclude="_log" --exclude="_rss" --exclude="_sessions" --exclude="_tmp" --exclude="_uploads" -zcvf files.tar.gz files/ 

If you use a method other than the one mentioned, we invite you to exclude from compression the folders cited below, from the files folders:

  • _cache

  • _cron

  • _dumps

  • _graphs

  • _lock

  • _log

  • _rss

  • _sessions

  • _tmp

  • _uploads


Alternative method: graphical tool (HeidiSQL)

If you are not comfortable with command lines, you can use a graphical tool like HeidiSQL which we recommend here to build your dump.

Follow all the steps in this guide to make sure the dump is complete and well built!

  • Connect HediSQL to your database

  • Once connected to your database, right click on it.

  • Click on Export database to SQL (graphical tool)

Alt text

In the export tool, make sure that only your database is selected.

  • Check Create in Table(s)

  • Choose INSERT in Data

  • Choose .sql file compressed in ZIP in the Destination

  • Name your file

  • Click on Export

Alt text
  • Export via PHPMYADMIN : most of the time, dumps are incomplete, with syntax errors, change undesired variable, etc.

  • Maintenance menu of GLPI : Legacy feature, dumps export is incomplete

  • Powershell : most of the time, dumps is done with non-standard encoding

Last updated