Updating from an Older Version
How to update the script without losing your data, and what changed since older versions.
What is gone
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
Stop the server.
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 toresources) instead. Copy that one.Coming from 1.x or 2.x: the old script's
backups/folder, if it has one.
Delete the old
tgiann-fivem-stats-scriptfolder and put the new one in its place.Put the folders from step 2 into the new script folder:
tgiann-fivem-stats-script/tgiann-media/andtgiann-fivem-stats-script/backups/.Make sure
server.cfghasset sv_enableHttpServer true, yourtgiann_stats_secret_keyandadd_unsafe_child_process_permission "tgiann-fivem-stats-script", see Installation. Removetgiann_media_storageif you set it.Open the media port (and port 80 for automatic HTTPS), see Ports and Firewall.
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 printsstats: 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 totgiann-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.jsonand come over with the folder.