How do I back up my FiveM server and database?

A complete FiveM backup includes the database, the resources folder, server.cfg and the txAdmin data folder. Dump the database daily with mysqldump or your panel's tool, archive the server files at least weekly and after every big change, and copy everything to storage that is not on the same machine. A backup only counts once you have restored it successfully on a test server.

What actually needs backing up

Most owners remember the database and forget the rest. A full restore needs all of these:

ItemWhy it mattersHow often
DatabaseCharacters, money, vehicles, houses, inventoriesDaily, or more on busy servers
resources folderYour scripts, configs and custom editsAfter every change, plus weekly
server.cfg and other cfg filesConvars, ensure order, permissionsAfter every change
txAdmin data folderAdmins, bans, warnings, settingsWeekly
Keys and secretsLicense key, Tebex secret, bot tokensStore securely, separately

Artifacts themselves do not need backing up. You can always download them again. See updating artifacts.

Step 1: Database dumps

On Linux with MariaDB, a simple daily dump looks like this:

mysqldump --single-transaction --routines -u backup -p'secret' fivem | gzip > /backups/db/fivem-$(date +%F).sql.gz

Schedule it with cron at a quiet hour:

0 5 * * * /home/fivem/scripts/db-backup.sh

On Windows, the same mysqldump tool ships with MariaDB and can be scheduled with Task Scheduler. Use a dedicated database user with read-only rights for backups, not your root account.

Step 2: File backups

Archive the server data folder, excluding caches:

tar --exclude='cache' -czf /backups/files/server-$(date +%F).tar.gz /home/fivem/txData

The cache folder is rebuilt automatically and only wastes space.

Step 3: Get it off the machine

A backup on the same disk as the server protects against mistakes, not against a dead disk, a cancelled VPS or a compromised box. Copy backups to:

  • Object storage from a different provider
  • A second server or home NAS
  • At least one location your game server cannot delete from

The common 3-2-1 rule works well: three copies, two different media, one offsite.

Step 4: Retention

Keep daily database dumps for one to two weeks and weekly ones for a few months. Bugs and exploits are often discovered days after they happened, and you will want a dump from before the damage.

Step 5: Test the restore

Once a month:

  1. Spin up a test server.
  2. Import the latest dump and extract the files.
  3. Start the server and log in with a known character.
  4. Check money, inventory and vehicles look right.

If you have never restored a backup, you do not know whether you have one.

Before risky changes

Take a manual backup before:

  • Framework or inventory migrations
  • Large script updates
  • Changing sv_enforceGameBuild
  • Wiping or editing tables by hand

Checklist

  • Daily database dumps
  • File archives after changes and weekly
  • Offsite copy that the game server cannot delete
  • Retention policy set
  • Restore tested this month

Backups also save you after an exploit. Pair them with good logging from cheater protection so you know which dump to roll back to.

Related questions

Stop being invisible on the server list

Upvote power decides where your server appears. FiveM Upvotes delivers it — paced, refilled, with no access to your server required.