# Migration from v1

{% hint style="warning" %}
Ignore this guide unless you are migrating from **v1** of the resource!&#x20;
{% endhint %}

Thank you so much for continuing to use Advanced Garages. Your ongoing support is why we keep developing this script [🧡](https://emojipedia.org/apple/ios-14.5/orange-heart/)

Migrating is really simple, you only need to make a few SQL changes stated below. Advanced Garages still pulls from the default vehicles table, so you won't lose any of your data if you're migrating from Advanced Garages v1.

<details>

<summary>QBCore Users</summary>

Run the following SQL for the new job/gang ownership check

```sql
UPDATE `player_vehicles` SET `citizenid` = `license` WHERE `license` NOT LIKE 'license:%';
UPDATE `player_vehicles` SET `damage` = '';
```

</details>

<details>

<summary>ESX Users</summary>

Run the following SQL to add the columns that used to be QB only. Since the script is now universal, you need these for it to work.

```sql
ALTER TABLE `owned_vehicles` ADD COLUMN IF NOT EXISTS `gang_vehicle` TINYINT(1) DEFAULT '0';
ALTER TABLE `owned_vehicles` ADD COLUMN IF NOT EXISTS `gang_vehicle_rank` INT(10) DEFAULT '0';
UPDATE `owned_vehicles` SET `damage` = '';
```

*Just to note, gang garages functionality still isn't included, as gangs aren't part of ESX by default.*

</details>

We don't recommend that you try to migrate your `config.lua` file. Just use our new Configurator tool linked above, and you will have the script configured to your servers needs again in just minutes :smile:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jgscripts.com/advanced-garages/migration-from-v1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
