> For the complete documentation index, see [llms.txt](https://tyrix.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tyrix.gitbook.io/docs/script-resources/tyrix-business/migration.md).

# Migration

Running a server that used **pug** business resource? Tyrix Business ships a one-shot importer that rewrites every `pug_businesses` row into tyrix's schema.

## Running it

From the **server console** (txAdmin, or your host's console - not in-game chat):

```bash
switchtotyrix
```

The command refuses to run for any non-console source (`source ~= 0`), so it can't be triggered by a player.

## What gets migrated

Per business row from `pug_businesses`:

* `registers`
* `trays` (imported with `public = true`)
* `storage`
* `trashcans`
* `bossmenu` → `bossmenus`
* `clothing`
* `blip` (array shape converted to the tyrix object shape)
* `props`
* `garage` → `garages`
* `cookstations` - expanded into both `tyrix_crafting_stations` rows and `tyrix_recipes` rows

## What is NOT migrated

Pug has no equivalents for these, so they're initialized empty. Place them from the Business Manager after import:

* **Peds** (new NPCs)
* **Shops** (`ox_inventory`-registered shops)
* **Seats**
* Legacy `crafting` column (superseded by `tyrix_crafting_stations`)
* **Supply Runs**
* **Custom Menus**

## Import defaults

* Every migrated feature is placed with `minGrade = 0`. You'll want to tune grades in the Business Manager afterwards.
* Recipe craft time defaults to **5000 ms**.
* Recipe labels are derived from the item id via capitalize + underscore-to-space — e.g. `bacon_burger` → `Bacon burger`. Auto-generated labels often look mangled; rename in the Recipe Manager after import.
* Recipe `maxAmount` defaults to **1**.

## When to run

Once, right after installing tyrix\_business on a server that used pug.

Re-running is safe - the underlying `INSERT`s use the existing `job` slug and duplicate rows fail rather than clobber - but there's nothing to gain from running it twice.

## After import

1. Open `/business` and step through each imported business.
2. Retune grades on migrated features (defaults are all `minGrade = 0`).
3. Rename any recipe labels the auto-transformer mangled.
4. Place the feature types pug didn't have (peds, shops, seats, supply runs, custom menus).
