Migrations
Move your garages and vehicles from another garage script into Garages.
Garages can read another garage script's database and move it over, so you keep your garage locations and every vehicle stays where it was parked. Migrations are run with the gmigrate console command, added in Garages 2.8.2.
#Supported Scripts
| Script | Versions | Source Name | Garages | Private Garages | Impounds | Job & Gang Vehicles | Shared Vehicles |
|---|---|---|---|---|---|---|---|
| jg-advancedgarages | v3, v4 | jg | ✅ | ✅ | ✅ | ✅ | ✅ |
Using a garage script that isn't listed? Let us know in our Discord.
#Migrating
#Stop Your Old Garage Script
Remove it from your
server.cfg, but leave its database tables in place. The migration reads from them.
#Back Up Your Database
The migration changes your vehicle table. If anything goes wrong, restore the backup before trying again.
#Install Garages
Follow the Setup guide and start the server. See First Install for what happens when old data is found.
#Preview
Run this in the server console:
gmigrate <source>Nothing is written. The console lists the garages that will be created, how many vehicles will be moved, and any old garages vehicles point at that can't be found. Create those in the garage builder first if you want the vehicles to end up there.
#Run
gmigrate <source> runThe console prints a summary. Vehicles that fail are listed with their plate, owner and the reason, and the rest are still moved.
#Commands
gmigrate only works from the server console.
| Command | What It Does |
|---|---|
gmigrate <source> | Shows what would be moved, without writing anything. |
gmigrate <source> run | Runs the migration. |
gmigrate <source> run force | Runs it again. This moves every vehicle back to its old garage and undoes changes made since. Existing garages are left alone and job vehicles are not handed out twice. |
gmigrate <source> skip | Ignores the old data on a first install and adds the starter garages instead. |
#First Install
If Garages finds old garage data the first time it starts, it waits for the migration instead of setting itself up as usual:
- The starter garages are not added.
- Vehicles are not given a VIN and a default garage, which would overwrite where they are parked.
- The console reminds you every 5 minutes.
Running the migration ends this and adds only the starter garages that are still needed: ones with the same name as an old garage that only existed in the old script's config, and a default impound if none was migrated. skip ends it and adds all starter garages.
If Garages is already set up on your server, you can still migrate. The old garages are added next to your existing ones, so check that they don't overlap.
#What Gets Moved
Garages keep their name, zones, spawn points, vehicle types, blip and active state. Point zones become round zones with the same radius.
| Old Garage | Becomes |
|---|---|
| Public | Public garage |
| Job or gang | Profession garage for the same jobs and gangs |
| Private or purchased | Private garage with the same owner and players |
| Impound | Public impound for the same impound jobs, or your default impound job |
| Job garage that spawns vehicles from a list | Profession garage, with one profession vehicle per listed model |
A garage whose id already exists in Garages is skipped.
Vehicles go to their old garage. If it can't be found, they go to a garage with the same name, the garage they already have in Garages, or their default garage, in that order. Everything that isn't impounded is stored.
- Impounded vehicles stay in their garage with an impound record that keeps the reason, cost, time left and police lock.
- Job and gang vehicles become profession vehicles.
- Shared vehicles keep their shared access.
Not moved: interiors, grade limits, favourites, loans, trailers and saved damage.
On QBCore and Qbox, some garage scripts store a number in the impound column of player_vehicles, where Garages stores text. The migration converts the column, so the old script can't use that database again afterwards.