backupsdatabasedisaster recovery10 min read · updated 9/11/2026

Backing up a FiveM server properly

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.

Short answer: 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.

FiveM Server Backups: Database, Resources and txData (Automated)

#What to back up

WhatWhyHow often
DatabaseCharacters, money, inventories, vehicles, housesDaily (or more)
server-dataResources, server.cfg, custom editsAfter changes; weekly
txDatatxAdmin admins, bans, warnings, player historyDaily
Secrets (licence key, tokens)Needed to rebuildStored safely once

#Dumping the database

Linux
mariadb-dump -u backup -p"$DB_PASS" --single-transaction --routines --triggers fivem | gzip > /backups/fivem-$(date +%F).sql.gz
Windows (adjust the MariaDB version in the path)
"C:\Program Files\MariaDB 11.4\bin\mariadb-dump.exe" -u backup -p%DB_PASS% --single-transaction --routines --triggers fivem > C:\Backups\fivem.sql

Create 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

/etc/cron.d/fivem-backup
# 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 -delete

Run 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

Restore into a test database
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_restore

Point 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?
Run mariadb-dump --single-transaction (or mysqldump) on your database daily and keep compressed copies off the server.
Does txAdmin back up my database?
No. txAdmin keeps its own data in txData; back up the database yourself.
How long should I keep backups?
7–30 daily backups plus a few weekly or monthly ones cover most situations.
Can I back up while the server is running?
Yes. --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.