Skip to content
Blog

How to restore one FiveM player’s inventory after a dupe or bug

Give one player back their items, money and cars on ESX, QBCore or ox_inventory from a backup, without rolling back the whole server. SQL included.

By Termi

5 min read
  • Backups
  • Rollback
  • ox_inventory
  • Dupes
On this page

A bug eats a player’s inventory, or a dupe leaves one player with forty pistols that share a serial number. Rolling the whole server back to last night punishes everyone who played since. The better fix is to restore only the rows that belong to one character. This guide shows where ESX, QBCore and ox_inventory keep those rows, how to copy them out of a backup by hand and how to find duplicated items in the first place.

Where a character lives in the database

  • ESX keeps the character in users, keyed by identifier, with money in the accounts JSON column and, with ox_inventory, items in inventory. Cars are in owned_vehicles, keyed by owner.
  • QBCore and Qbox keep it in players, keyed by citizenid, with money and inventory as JSON columns. Cars are in player_vehicles.
  • ox_inventory adds the ox_inventory table for stashes, keyed by owner and name, and keeps a car’s trunk and glovebox in the trunk and glovebox columns of the vehicle table.
  • Everything else sits in its own tables: user_licenses on ESX, and playerskins, player_outfits and apartments on QBCore.

Restore one character by hand

You need a backup from before the damage, loaded into a separate database. Never load it over the live one. First make sure the player is offline and stays that way until you finish: the framework saves the inventory it holds in memory on the next save or when they disconnect, and that save overwrites your restore.

Load the backup into a scratch database next to the live one:

terminal
mysql -u root -p -e "CREATE DATABASE restore_scratch"
mysql -u root -p restore_scratch < fivem-2026-10-22.sql

Then copy the character’s columns back from the scratch database. fivem is the live database here; use your own name:

QBCore · Qbox
UPDATE fivem.players AS live
JOIN restore_scratch.players AS old ON old.citizenid = live.citizenid
SET live.inventory = old.inventory, live.money = old.money
WHERE live.citizenid = 'ABC12345';
ESX · ox_inventory
UPDATE fivem.users AS live
JOIN restore_scratch.users AS old ON old.identifier = live.identifier
SET live.inventory = old.inventory, live.accounts = old.accounts
WHERE live.identifier = 'char1:9a4f00ab12cd34ef';

Cars and stashes follow the same pattern, by citizenid or owner. Watch for a car the player sold or a plate someone else now owns before you copy rows back, and drop the scratch database when you are done.

A row-level restore puts the whole inventory back as it was at the backup, so anything the player earned since then disappears. Tell them which time you restored to.

Find duplicated items first

If the damage was a dupe, restoring the duper isn’t enough, because the copies may already have been sold or handed out. Weapons and other unique items carry a serial: metadata.serial in ox_inventory and info.serie in qb-inventory. The same serial in two places is a copy. On MySQL 8 or MariaDB 10.6 and later, this lists every serial that appears more than once among QBCore players running ox_inventory:

duplicate serials
SELECT j.serial, COUNT(*) AS copies, GROUP_CONCAT(p.citizenid) AS holders
FROM players AS p,
  JSON_TABLE(p.inventory, '$[*]' COLUMNS (serial VARCHAR(64) PATH '$.metadata.serial')) AS j
WHERE j.serial IS NOT NULL
GROUP BY j.serial
HAVING copies > 1;

For ESX, swap players and citizenid for users and identifier; for qb-inventory, use $.info.serie as the path. Stashes, trunks and gloveboxes hold items too, so run the same query over ox_inventory.data and the vehicle table before deciding who duped.

Restore one player with FiveDock

FiveDock does the scratch database work for you. On Metro, pick a backup and a player in the panel, and FiveDock restores only the rows tied to that player’s identifiers across the framework’s tables: the character with its money and inventory, cars, licenses, skins, outfits, apartments and ox_inventory stashes. Before anything changes, it shows how many rows the restore will touch.

Duplicate item alerts on Metro watch for the same serial in two inventories, or a stack that grows with nothing to explain it. Each finding keeps who held the item and a backup from that moment, so the restore point is already there when you look. Money alerts, on every plan, post to Discord when a transfer crosses a threshold or a player gains money too fast.

The backups themselves come with every plan: daily on Free and City, hourly on Metro, encrypted on your machine with a key FiveDock never sees. On Free and City a restore puts back the whole server; one table or one player is Metro.

Common questions

Can you restore one player in FiveM without a full rollback?

Yes. Load a backup from before the problem into a separate database and copy that character’s rows back: players on QBCore or users on ESX, plus their cars and stashes. FiveDock Metro does this from the panel, one player at a time, with a count of the rows it will change.

How do I find duped items on my FiveM server?

Look for unique serials held more than once. ox_inventory stores a weapon’s serial in metadata.serial, so a JSON_TABLE query over the inventory column lists every serial with more than one copy. FiveDock’s duplicate item alerts run that check for you and post to Discord.

Will restoring a player remove items they earned after the backup?

Yes. A row-level restore puts the whole column back as it was at backup time. Pick the latest backup from before the problem, and tell the player which time you restored to.

What if the player is online during the restore?

Their framework saves what it holds in memory on the next save or when they disconnect, and that overwrites the restore. Kick them, or wait until they are offline.

All articles