Migrate from QBCore
Moving from QBCore to Shiva. This guide covers what maps where, what to rewrite, and how to run both in parallel during migration.
WARNING
This is a non-trivial migration. Plan for 2–4 weeks for a typical QBCore server depending on the number of custom resources.
Concept Mapping
| QBCore | Shiva Equivalent |
|---|---|
QBCore.Functions.GetPlayer(source) | player:get(source) via IPlayer contract |
QBCore.Functions.GetPlayerData() | player:get(source) (server) or LocalPlayer.state (client) |
QBCore.Functions.AddMoney(src, account, amount) | economy:addMoney(source, account, amount) |
QBCore.Functions.RemoveMoney(src, account, amount) | economy:removeMoney(source, account, amount) |
QBCore.Functions.AddItem(src, item, amount) | inventory:addItem(source, item, amount) |
QBCore.Functions.RemoveItem(src, item, amount) | inventory:removeItem(source, item, amount) |
QBCore.Functions.HasItem(src, item) | inventory:hasItem(source, item) |
QBCore.Functions.SetJob(src, job, grade) | jobs:setJob(source, job, grade) |
QBCore.Functions.Notify(src, msg, type) | notify:notify(source, type, msg) |
RegisterNetEvent / TriggerEvent | Same in Shiva — but use IEventBus for module-to-module |
Migration Strategy
Phase 1: Run in Parallel (Week 1)
- Install Shiva alongside your existing QBCore setup
- Don't remove QBCore yet
- Migrate one standalone resource at a time (fishing, drugs, etc.)
- Each migrated resource talks to Shiva contracts
Phase 2: Core Data (Week 2)
- Migrate player characters from QBCore DB schema to Shiva schemabash
shiva migrate --from qbcore - Migrate economy accounts
- Migrate inventory items
Phase 3: Remove QBCore (Week 3–4)
- Remove QBCore dependency from remaining resources one by one
- Replace
QBCore.Functions.*calls with Shiva contract calls - Test each resource after migration
Database Migration
Run the included QBCore migration script:
bash
shiva migrate --from qbcore --dry-run # preview changes
shiva migrate --from qbcore # executeThis maps:
players→ Shiva character tableplayer_vehicles→shiva_vehiclesitems+user_inventory→shiva_inventorybank_accounts+player_accounts→shiva_accounts
Getting Help
Join #migration in the Discord — the community has migrated dozens of servers.