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

Database Backups

Scheduled backups of your game database, how to download and restore them.

The media service backs up your game database (the one in mysql_connection_string) to tgiann-media/backups/backup-<date>.sql.gz inside the script folder. Each backup is one consistent snapshot taken while the server runs, players stay online. It restores exactly, float coordinates included.

If your server.cfg limits who can read mysql_connection_string with add_convar_permission, add add_convar_permission tgiann-fivem-stats-script read mysql_connection_string. Without it backups are off.

Turn them on

Backups are off until you turn them on on the Backups page:

Setting
Default
Range

Back up automatically

Off

Every

4 hours

1 to 168 hours

Keep

28 backups

1 to 500, older ones are deleted

The first automatic backup is checked 5 minutes after the server starts. Back up now on the same page takes one at once.

Download

Click the download button next to a backup on the Backups page. The file comes from the media port of your server, so that port must be open, see Ports and Firewall. A download link works for 10 minutes and only once.

Restore

Stop the server first and restore into an empty database (or one you are ready to overwrite).

Linux:

gunzip -c backup-2026-10-24_04-00-00.sql.gz | mysql -u root -p your_database

Windows: extract the .sql file with 7-Zip, then run it in HeidiSQL (File > Run SQL file) or:

What is not in a backup

The tgiann-media folder (statistics, logs, screenshots, videos). Copy that folder to keep them, see Media Service.

Backups live inside the script folder too: keep tgiann-media/ when you update the script, see Updating from an Older Version.

On Linux the backups folder and files are readable by the server's user only.