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

Updating from an Older Version

How to update the script without losing your data, and what changed since older versions.

What is gone

Old
Now

A separate API port (3737) and tgiann_stats_http_port / tgiann_stats_http_host

The panel connects through the game port. Remove the convars

Statistics in tgiann_stats_* MySQL tables

Stored by the media service in tgiann-media/stats.db. Nothing is written to your game database any more

Retention, ignored items and AFK time in config.lua

Edited in the panel: Settings > Game script

Node backups in the resource's backups/ folder, yarn and package.json

Backups by the media service, set on the Backups page. No yarn install needed

tgiann-media/ in your server data folder and the tgiann_media_storage convar (earlier 3.x versions)

tgiann-media/ inside the script folder, because FXServer's sandbox blocks folders outside resources. Remove the convar

Steps

  1. Stop the server.

  2. Copy your data out of the old version:

    • tgiann-fivem-stats-script/tgiann-media/: statistics, logs, screenshots, videos and backups.

    • Earlier 3.x versions kept tgiann-media/ in your server data folder (next to resources) instead. Copy that one.

    • Coming from 1.x or 2.x: the old script's backups/ folder, if it has one.

  3. Delete the old tgiann-fivem-stats-script folder and put the new one in its place.

  4. Put the folders from step 2 into the new script folder: tgiann-fivem-stats-script/tgiann-media/ and tgiann-fivem-stats-script/backups/.

  5. Make sure server.cfg has set sv_enableHttpServer true, your tgiann_stats_secret_key and add_unsafe_child_process_permission "tgiann-fivem-stats-script", see Installation. Remove tgiann_media_storage if you set it.

  6. Open the media port (and port 80 for automatic HTTPS), see Ports and Firewall.

  7. Start the server. Coming from 1.x, change the port in the panel to the game port: Settings > Connection.

How old data comes over

  • Statistics: the old tgiann_stats_* tables are imported once, in parts, on the first start. The console prints stats: imported <n> rows from <table> for each. If the server stops halfway, the import continues on the next start. The old tables are not deleted; drop them yourself once the panel shows your history.

  • Backups: files in the script's backups/ folder (step 4) are moved to tgiann-media/backups/ and your old backup settings are kept.

  • Settings: coming from 1.x or 2.x they start from the defaults. Check them once in Settings > Game script. From 3.x they are in tgiann-media/settings.json and come over with the folder.