Migrating from Other Door Lock Scripts
tc_keys includes a migration tool to import door locks from other systems. Currently, migration from ox_doorlock is supported.
⚠️ Important: The migration command can only be run from the server console. Running it in-game will display an error.
Prerequisites
- tc_keys must be installed and running
- Used a supported doorlock resource
Migration Command
From your server console (not in-game), run:
keysmigrate ox
This reads all door locks from the ox_doorlock table and imports them into tc_keys.
Command Usage
| Argument | Description |
|---|---|
ox | Migrate from ox_doorlock (currently the only supported source) |
If you run the command without arguments or with an invalid argument:
keysmigrate
You will see:
[tc_keys] migrate: Usage: migrate ox
[tc_keys] Migrates all door locks from ox_doorlock table to tc_keys.
What Gets Migrated
Door Data
The migration converts ox_doorlock's data format to tc_keys
Access Control
- Groups - ox_doorlock's
groupsare converted to tc_keys job access:- Grade
0→ All grades (any player with that job) - Other grades → Specific grades only
- Grade
💭 Note: Migrated doors are created with medium lockpick difficulty and key-based access. You can edit them afterward in the door locks UI to change access type (keypad, fingerprint) or lockpick difficulty.
Door Names
- If the ox_doorlock record has a non-empty
name, it is used as the door label - Otherwise, the label is set to
Imported #followed by the original ox_doorlock ID
After Migration
When migration completes, restart tc_keys and the doors should be usable in-game!
Troubleshooting
"Failed to read ox_doorlock table"
- Ensure the
ox_doorlocktable exists in your database - Verify your database connection and that tc_keys can access the same database
"No door locks found in ox_doorlock"
- The ox_doorlock table is empty—there is nothing to migrate
- Confirm you are using the correct database that contains your ox_doorlock data
Some doors failed to migrate
- Doors with invalid or missing model data are skipped
- Check the console for each migrated door; failed doors are counted in the summary
- You may need to recreate failed doors manually using the in-game door lock creator