Backing up a FiveM server properly
Back up three things: the database (the most valuable), the server-data folder (resources and configs) and txData (admins, bans, player history). Dump the database daily with mariadb-dump --single-transaction, compress it, keep 7–30 days, and copy it off the machine (for example with rclone to object storage). Test a restore on a separate database at least once.
Every long-running server eventually has its bad day: a script wipes inventories, a disk dies, a staff account is compromised or a host disappears. The servers that survive are the ones with yesterday’s database somewhere else. Backups are boring to set up once and priceless the first time you need them.

#What to back up
| What | Why | How often |
|---|---|---|
| Database | Characters, money, inventories, vehicles, houses | Daily (or more) |
| server-data | Resources, server.cfg, custom edits | After changes; weekly |
| txData | txAdmin admins, bans, warnings, player history | Daily |
| Secrets (licence key, tokens) | Needed to rebuild | Stored safely once |
#Dumping the database
mariadb-dump -u backup -p"$DB_PASS" --single-transaction --routines --triggers fivem | gzip > /backups/fivem-$(date +%F).sql.gz"C:\Program Files\MariaDB 11.4\bin\mariadb-dump.exe" -u backup -p%DB_PASS% --single-transaction --routines --triggers fivem > C:\Backups\fivem.sqlCreate a dedicated backup user with only the rights it needs (SELECT, SHOW VIEW, TRIGGER, LOCK TABLES, EVENT). On MySQL the tool is called mysqldump; MariaDB ships both names.
#Automating and rotating
# every day at 05:30, keep 14 days
30 5 * * * root /usr/local/bin/fivem-backup.sh && find /backups -name "fivem-*.sql.gz" -mtime +14 -deleteRun the dump at a quiet time, ideally a few minutes after a scheduled restart. On Windows, a Task Scheduler task running a .bat file does the same job.
#Off-site copies
Copy backups away from the server — object storage, another VPS or a home NAS. rclone copy /backups remote:fivem-backups works with most storage providers. Follow the 3-2-1 idea: three copies, two kinds of storage, one off-site.
#Practising a restore
mariadb -u root -p -e "CREATE DATABASE fivem_restore CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
gunzip < /backups/fivem-2026-09-10.sql.gz | mariadb -u root -p fivem_restorePoint a test server at fivem_restore and log in. If your character, money and vehicles are there, your backups work. Database setup basics: MariaDB setup.
Questions
How do I back up my FiveM database?
mariadb-dump --single-transaction (or mysqldump) on your database daily and keep compressed copies off the server.Does txAdmin back up my database?
How long should I keep backups?
Can I back up while the server is running?
--single-transaction makes a consistent dump of InnoDB tables without stopping the server.Ready to pick a map?
Twelve themes on three base map styles, $8 each, instant download.
Relevant to what you just read
Look it up while you work
The reference tables this guide leans on, free and without an account.
- All 921 vehicle spawn namesEvery vanilla model with a picture, its display name, its class and the hash CreateVehicle takes.