# Export local database

## Recommended method : via CLI

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
```

## 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](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-4e2e4457fd4f8a9470594db1f6e697af0477d0ba%2Fexport_bdd-1.png?alt=media)

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](https://2961961068-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsGALtnzA2IROeldmXKt5%2Fuploads%2Fgit-blob-5ea7c7e30f24dceb1107dc424eeed63de1dff23b%2Fexport_bdd-2.png?alt=media)

## Not recommended

* 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
