Migrating from JG Garages
Garages V2 can import a server running jg-advancedgarages: every JG garage becomes a kartik garage, and every vehicle ends up in the garage JG had it in. It reads straight from your database, so there is nothing to export.
๐ฆ What Gets Migrated
| JG | Garages V2 |
|---|---|
Garage locations (garage_locations) | Garages with the same name, type, owner, blip and parking spots |
| Public, job, gang and impound garages | public, job, gang and impound garages |
| Purchased or for-sale garages | private garages, owned or listed for sale |
car / air / sea garages | Cars, bikes & trailers / helicopters & planes / boats & submarines |
| Job garages showing owned vehicles | Shared job garages |
Vehicle's garage (garage_id) | Vehicle's garage |
Job vehicles (job_vehicle) | Job-owned vehicles |
Job vehicle rank (job_vehicle_rank) | <Job> - Grade X+ access groups |
| Impounded vehicles | Stay impounded, at the matching impound lot |
Garage Zones
JG garages are a point with a radius; kartik garages are a zone. The migration draws the zone around the JG radius and every parking spot, so each spot is always inside the zone, even where JG's spawn point sat outside its radius. JG garages that already use a polygon keep their exact points.
What Does Not Carry Over
These have no equivalent and are listed in the report so nothing is dropped silently:
- JG interiors, per-garage marker styles and blip scale.
- JG-only vehicle rules: infinite spawns, pooled vehicles and spawner garages.
- Grade limits on a JG garage itself (vehicle ranks do carry over).
- Gang vehicles stay with their owner, as Garages V2 has no gang-owned vehicles.
๐ Running the Migration
Back up your database first, and stop jg-advancedgarages. The migration refuses to write while it is running, as both scripts would overwrite each other's changes.
- Start
kartik-garagesonce so its tables are created. - In the server console, run
migratejg. This is a dry run: it prints exactly what would happen and writes nothing. - Check the report, especially vehicles in missing JG garage (see Fallback Garage).
- Run
migratejg run. restart kartik-garagesto load the new garages.
| Command | Description |
|---|---|
migratejg | Dry run. Prints the full report, changes nothing. |
migratejg run | Imports the garages and moves the vehicles. |
migratejg rollback | Puts every migrated vehicle back as it was and removes the imported garages and access groups. |
All three run from the server console only.
Running migratejg run again is safe: garages and vehicles that were already migrated are skipped. Garages that already exist in Garages V2 under the same name (ignoring case) are not created twice; their vehicles are pointed at the existing one.
๐ Safety
- Backup before every change: each vehicle's old values are saved in
kartik_jg_backupbefore it is touched, which is whatrollbackrestores. - Batched: vehicles are moved 500 at a time, each batch in one transaction, so large servers do not stall.
- JG data is never deleted: JG's tables and columns stay as they are. Drop them yourself once you are happy.
๐งญ Special Cases
Fallback Garage
A vehicle can point at a JG garage that no longer exists, for example one that was renamed or deleted. Such vehicles go to the first of:
fallbackGaragefrom the config, when set.- The vehicle's current Garages V2 garage, if it exists.
Config.DefaultGarage.- JG's own default garage (the default of its
garage_idcolumn, usually Legion Square).
Vehicles Out When JG Stopped
Vehicles that were out in the world are no longer there once the server is stopped. By default they are put back in their garage, stored, at no cost (outVehicles = "store").
Job Vehicle Ranks
For each job and rank above 0, the migration creates an access group such as Police - Grade 5+, owned by the job, with every grade from that rank upwards ticked, and puts the matching vehicles in it. Rank 0 vehicles stay open to the whole job. Bosses can edit these groups like any other. See Access Groups โ Job Vehicles.
โ๏ธ Configuration (shared/migration_config.lua)
Config.JGMigration = {
enabled = true,
blockingResources = { "jg-advancedgarages" }, -- Refuses to run while these are started
locationsTable = "garage_locations",
importDisabled = false,
fallbackGarage = nil, -- For vehicles whose JG garage is gone (nil = current garage, Config.DefaultGarage, then JG's default)
fallbackImpound = nil, -- nil = first impound lot
outVehicles = "store", -- "store" | "impound" | "keep"
rankGroups = true, -- JG job_vehicle_rank -> "<Job> - Grade X+" access groups
zone = {
segments = 12,
spawnPadding = 3.0, -- Metres around each parking spot kept inside the zone
minHeight = 4.0,
},
vehicleTypes = { -- JG vehicle_type -> kartik vehicle types
car = { "automobile", "bike", "trailer" },
air = { "heli", "plane" },
sea = { "boat", "submarine" },
},
batchSize = 500,
}| Option | Description |
|---|---|
importDisabled | Also import garages that are disabled in JG. Vehicles in disabled garages otherwise go to the fallback garage. |
outVehicles | store puts them back in their garage. impound sends them to the impound lot with Config.ImpoundPrice. keep leaves them out for Config.RestartImpoundMode to handle. |
rankGroups | Set to false to leave job vehicle ranks out; the vehicles are then open to the whole job. |
zone.spawnPadding | Extra room around each parking spot, so a vehicle on the edge spot is fully inside the zone. |