Skip to main content
TRACK B·FRAMEWORK INTEGRATION·Verified June 2026 · Lua 5.4 · ox_lib 3.x
Learning with an AI assistant?
Copies this lesson plus 2026 ground rules (no lua54 'yes', Cfx.re Portal, correct callback signatures) as a ready-to-paste mentor prompt.

Inventory migration: QB, ESX, ox

Replacing your inventory is one of the most disruptive changes you can make, because half your scripts touch items. Moving to ox_inventory is popular for good reason, but it is a migration, not a drop-in. This lesson gives you the plan, the bridge concept, the data-shape difference that actually loses items, and the test that proves you did not.

You'll learn
Why inventory is load-bearing, what the compatibility bridge covers, how QB/ESX item data differs from ox_inventory, and how to plan the migration so nobody loses items.
Time
~25 minutes.
You need
A framework server and the ox/oxmysql lessons.
BEFORE YOU START

Plan the migration

Map what touches the inventory

You know every script that adds, removes, or checks items.

List the resources that call inventory functions: shops, jobs, crafting, drugs, anything that grants or takes items. These are what will break, and what you must update or bridge.

Understand the compatibility bridge

You know whether old scripts can keep working during the move.

ox_inventory ships compatibility shims that re-expose the common framework inventory exports (the QB AddItem/RemoveItem/GetItemByName calls and the ESX addInventoryItem/removeInventoryItem/getInventoryItem calls) so many scripts work with minimal change. The docs are explicit that these are best-effort: anything that read the framework's raw inventory table or used a niche export still needs real edits. Plan for both.

Migrate the items definitions and the data

Existing items map into the ox_inventory format and player data carries over.

Convert your framework items (QB shared/items.lua or the ESX items table) into ox_inventory's data/items.lua format, then migrate the existing player inventory rows. For ESX, ox_inventory ships an official migration command: with the server running, type convertinventory esx into the FXServer console (the same window where you see server logs, or the txAdmin Live Console), then convertinventory esxproperty if you use property storage, and restart the server when it finishes. For QBCore, ox_inventory ships convertinventory qb, which migrates both player and vehicle inventories (and maps QBShared.Items into ox_inventory's item data); run it the same way and restart the resource when it finishes. Either way, do it on a copy of the database first, against your backup. The next section shows the exact shape difference so you understand what the converter (or your script) is doing.

Test on a copy before going live

Items survive and scripts still grant/take correctly.

On a test server with the backup restored: load a character, confirm their items are intact, then run each item-touching script (buy, sell, job reward) and confirm it works.

Keep reading the full lesson

Sign in to start, then unlock every step of this lesson and the full FiveM School with a membership.

Still ahead in this lesson
  • How it works
  • Common mistakes
  • What you can do now

The remainder of Inventory migration: QB, ESX, ox is available to FiveM School members.