Stick's Resources

Migration

Import items from ox_inventory's data files into ItemsDB.

READ ME BEFORE MIGRATING

The migration process is not perfect. Data may not transfer exactly as expected - item fields can be misinterpreted, callbacks will be stripped, and edge cases in your data files may produce unexpected results. Verify the inserted data in your database before proceeding. We are not responsible for data loss if you skip this step. You've been warned.

Run this once from the server console (not in-game chat):

ItemsDB:migrate

This reads ox_inventory/data/items.lua and ox_inventory/data/weapons.lua, imports every item and weapon into the database, and generates shared/callbacks.lua with stub functions for any Lua callbacks (add, remove, effect, buttons.action, server.cb).

Idempotency

The migrator is safe to run multiple times. Each run preserves existing database rows via ON DUPLICATE KEY UPDATE.

However, shared/callbacks.lua is completely regenerated on every run without any confirmation prompt and without a backup. If you have implemented any callbacks in that file, they will be gone. Make a backup of shared/callbacks.lua before running the migrator again. Please ensure you have a backup before proceeding.

We plan to improve the callback generation process in the future to make it more user-friendly and less prone to data loss.

Next Steps

With migration done, implement your callback stubs - see Callbacks.

On this page