# 🚢 Migration

## Migration

Our plugin can bring your shops across from other shop plugins, and from some of them the player data too. Below are the available migration options.

* **ShopGUIPlus**
* **EconomyShopGUI** (free and Premium, shops plus stock, limits and purchase history)
* **UltimateShop**
* **ExcellentShop**
* **Essentials** (worth.yml)
* **QuickShop** (Hikari and Reremake, chest shops, as player shops)
* **Shop (snowgears)** (chest shops, as player shops)
* **ChestShop** (sign shops, as player shops)

The three chest shop migrations bring every player's shops across on Lite too, even past the 25 chest shops (30 on a linked server) a player can own there. Imported shops always load, and they count toward the limit, so a player at or over it cannot make another until they are below it. When a migration leaves players over the limit, the chat says how many, and a file in migrations/ lists each of them with how many shops they own.

## Running a Migration

Open **Editor > Migrations**. There is one button per plugin, listing the files it reads and whether player data comes across. A button is locked when those files are not in your plugins folder, so the other plugin's folder has to be there, but the plugin itself does not need to be running.

<figure><img src=".gitbook/assets/migrations/migrations.png" alt="" width="563"><figcaption><p>Editor (Migrations)</p></figcaption></figure>

1. Click the plugin to read its files and database. Nothing is written yet.
2. A confirmation opens, showing how many shops, categories, items, past transactions and limit counts were found. Confirm to write, or cancel to leave everything as it was.
3. The menu closes and the chat says when the migration has finished, and how many entries came from the old plugin's database. When the old plugin is still running, a second line asks you to remove it, since it would keep answering the same commands and signs.

Before anything is written, the whole plugin folder is copied to backups/, the SQLite database included. If the copy fails, nothing is written. The new shops are live straight away.

### Note

* Every plugin comes across as one shop opened with `/shop`, with one category per shop or section of the old plugin. `/shop <category>` opens a category directly, as it did before. If one of your shops already uses `/shop`, the import gets no command; give it one in the editor.
* Each category is named, described and iconed the way its button looked in the old main menu, head textures and custom model data included, and keeps that button's order.
* A shop's identifier that is already taken is skipped, never overwritten. Rename or delete yours first to import over it. Player data for a skipped shop is skipped with it.
* Every entry that is left out is named with its file in migrations/, one file per plugin. The chat only says the migration finished, and points to that file when something did not come across.
* An item that cannot be read is left out and reported, and the rest of the import still comes across. Items newer than the plugin's material list import as long as the server knows them.
* Items come across in the order players saw them, page by page and slot by slot where the old plugin set them, otherwise in the order of the file. The exact slots and pages are not kept.
* An item that is bought for itself gives that item, with its name, lore and amount, the same as an item dropped on the editor. When the old plugin showed one item and handed out another, the shop shows the first and gives the second. Command, permission and link entries only run their commands.
* Items that carry a potion type, stored enchantments, a spawner mob, a head texture or custom model data are only bought back when the held item matches exactly, so a plain water bottle cannot be sold as a potion.
* Colours written as `#RRGGBB`, `{#RRGGBB}` or as a gradient pair are turned into the forms this plugin reads.
* The Lite edition holds 3 shops, and the default shop already counts. When the import would go past that, a menu lists the imported shops with the categories each one brings, and you pick as many as there are free slots. They are added next to your shops. When all 3 slots are taken, the import stops and asks you to delete a shop first; it never replaces one. Categories are not limited, so a whole import fits in one shop.
* On Lite, whatever needs Premium is left out, and the report says so for each one: currencies per category or item, item and placeholder currencies, requirements, conditions other than a permission, stock, limits, restocks, opening hours, category actions and sales, price modifiers, Sell Boosters entries and rotating sections, which show every item, chest shop staff, and chest shops paid in an item. A shop priced in an item currency is priced in money instead. Past transactions come across.
* Stock and per-player limit counts are left out with the Network add-on, since it keeps stock in its own tables.
* Past transactions older than the history keeps are left out, see the history setting in config.yml.
* An item from another plugin, such as ItemsAdder or Nexo, is kept, and only shows once that plugin is installed.
* A chest shop in a chunk that is not loaded during the import is imported anyway and checked when its chunk loads: its sign is rewritten to ours then, and a shop whose sign or container is gone is removed.

## ShopGUIPlus

Reads every shop in ShopGUIPlus/shops, the older single shops.yml, and the main menu in config.yml. A shop with a main-menu button is a category on the main menu. A shop that is only reached from another shop, through a link or a decoration that runs `/shopgui <shop>`, opens from that shop as a sub-category, looking like the button that led to it. A shop reached from neither is hidden and opens with `/shop <shop>`.

<figure><img src=".gitbook/assets/migrations/shopguiplus.png" alt="" width="563"><figcaption><p>Migrations (Migrate from ShopGUIPlus)</p></figcaption></figure>

Menu titles drawn with a resource pack font are not used as names, since they mean nothing in these menus.

| ShopGUI+ entry | Becomes |
| --- | --- |
| `item` | An item, with its amount, prices, name, lore, enchantments, item flags, custom model data, glow, spawner mob, armor trim, potion type, leather colour, banner patterns, goat horn sound and head texture. Its `placeholder` is what the shop shows. Items from ItemsAdder, Nexo, CraftEngine, HeadDatabase, ExecutableItems, Slimefun, MMOItems and MythicMobs keep their plugin item. |
| `command` | A buy-only item that runs the same commands, as the buyer when it ran as the buyer. Its command limit becomes the most per purchase. |
| `shop_link` | The linked shop opens from this one as a sub-category. A link to a shop that has its own main-menu button is left out. |
| `permission` | An item whose purchase gives each node with a LuckPerms command, and whose sale removes them. A node limited to one world is given in that world only. A requirement stops players buying a node they already have. |
| `enchantment` | A buy-only item that runs the vanilla `/enchant` command on the held item. A requirement stops the purchase unless the player holds something the enchantment can go on. |

Shop and item `messageBuy`, `messageSell` and `messageCannotAfford` become the messages of the category and item. Fireworks and unbreakable items come across as the exact item when the import runs on the server. A command entry without `runSingleCommand` ran once per item bought, so it is bought one at a time here. The click actions of the main config and of each shop become the category's click mappings, and a shop with its buy or sell screen turned off buys or sells one at a time on click. Extra buy and sell commands come across as purchase and sell commands, and required permissions as requirements. A shop's permission, per-item permissions and world blacklist become conditions. The shop's economy is mapped onto our currencies: Vault, PlayerPoints, VotingPlugin and Experience, with `EXP` as experience points and `EXP_LEVELS` as levels, so prices keep their value. Names and lore are only compared on a sale when `compareMeta` was on. An entry with a buy price of 0 becomes a [free](main-features/items/edit-item.md#free) item.

ShopGUI+ keeps no stock or limits. Player data comes across as follows:

| Data | Becomes |
| --- | --- |
| Transaction log (shop.log) | Past purchases and sales in the purchase history, read with the log and date formats from its config.yml. Command, permission and enchantment purchases are left out. |
| Players in its database, SQLite or MySQL as set in its config.yml | Used to tie each logged name to its player. |
| Global permission price modifiers (pricemodifiers.yml) | [Price modifiers](add-ons/sell-boosters/README.md#price-modifiers) in the Sell Boosters add-on, with the same `shopguiplus.pricemodifiers.<id>` permission, so players keep them without changes. Without the add-on they are reported. |
| Permission price modifiers for one shop or item | Their sell side becomes a [permission booster](add-ons/sell-boosters/README.md#permission-boosters) in the Sell Boosters add-on, with the same permission. Their buy side is left out. Without the add-on they are reported. |
| Per-player price modifiers set with its commands | Left out and counted in the report. Players left at the default are not counted. |

> **Warning:**
Permission entries assume LuckPerms. On another permissions plugin, change their purchase and sell commands after importing. The requirements on permission and enchantment entries only run on Premium.

## EconomyShopGUI

Reads EconomyShopGUI-Premium when it is there, otherwise EconomyShopGUI: the shop and section files, including those in sub-folders, or the older single shops.yml and sections.yml. Everything becomes one shop called `economyshopgui`, with one category per section. A sub-section opens from the section that links to it, named, iconed and ordered like the link button. A hidden section opens with `/shop <section>`. A section's click commands run when its category opens. A section that only decorates the main menu is left out.

<figure><img src=".gitbook/assets/migrations/economyshopgui.png" alt="" width="563"><figcaption><p>Migrations (Migrate from EconomyShopGUI)</p></figcaption></figure>

Items keep their amount, prices, currency, name, lore, enchantments, item flags, custom model data, glow, spawner mob, armor trim, potion types, goat horn sound, leather colour, head texture, most per purchase and least per sale. `displayname` and `displaylore` are what the shop shows, and `name` and `lore` go on the item the player gets. A `display-item` is what the shop shows while the player gets the item itself. `fixed-stack-size` works like `stack-size`. Plugin items keep their plugin item, except Oraxen, Brewery and EcoItems. Buy and sell commands come across, and items that also gave the item still give it. Delayed commands run straight away, and commands run with temporary OP run as the player. Prices in an `ITEM` economy, or in `buy-prices` and `sell-prices`, become an item currency on Premium. One with a `name` or `id` becomes a currency of its own under that name, and a `name` only accepts the item with that name. With several prices, the first one is kept. A negative price turns that side off, and a buy price of 0 makes the item [free](main-features/items/edit-item.md#free).

Fireworks, suspicious stews, ominous bottles, knowledge books, unbreakable items and `components` come across as the exact item when the import runs on the server. Custom model data is read from `CustomModelData`, `NBTData` and `components`.

| EconomyShopGUI option | Becomes |
| --- | --- |
| `permission` | A requirement on `EconomyShopGUI.shop.<section>.item.<permission>`. With `permission-requirement: false`, only players without it can buy. |
| `requirements` | `PERMISSION`, `LEVEL`, `REGION`, `PLACEHOLDER`, `TIME`, `PLAYTIME` and `ITEM` lines become requirements, with their denied message. `TIME` checks the time of day in the player's world, and `ITEM` the item's material and name anywhere in the inventory. `QUEST` lines are left out. Level and placeholder checks need PlaceholderAPI. |
| `level-requirement` | A requirement on the player's level. |
| `click-mappings` | The category's click actions, from the section or from config.yml. |
| `damaged-items` | Damaged items sell for their price times the durability left. `price-difference` is left out. |
| `max-buy: -1`, `max-sell`, `min-buy`, `hidePricingLore`, `close-menu`, item `click-commands`, `if-not-met` | Left out and reported. |

| EconomyShopGUI limit | Becomes |
| --- | --- |
| Global stock | Stock. Selling an item always puts it back in stock here, as `refill-stock: true` did. |
| Player stock | Player limit. |
| Player sell limit | Sell limit. |
| Restock timer or schedule | Restock. One clock refills an item here, so an item with several keeps the first. A per-player timer becomes one shared clock. |
| Global sell limit | Left out. |
| Dynamic pricing | Left out, the base price is kept. |

Premium also brings the player data across, from its SQLite database or from MySQL with the connection and table prefix in its config.yml:

| Data | Becomes |
| --- | --- |
| Stock left on each item | Stock left. |
| Each player's buys and sells within their limits | The same counts against our limits. |
| Advanced transaction log | Past transactions in the purchase history. A sale of several items at once is split per item. |
| Global sell limit counts, dynamic pricing state, per-player price modifiers | Left out and counted in the report. |

Discounts and sell multipliers in its config.yml come across when they are turned on. Those under `all` become [price modifiers](add-ons/sell-boosters/README.md#price-modifiers) in the Sell Boosters add-on with the same `EconomyShopGUI.discounts.<group>` or `EconomyShopGUI.sell-multipliers.<group>` permission. A sell multiplier for one section becomes a [permission booster](add-ons/sell-boosters/README.md#permission-boosters) on that category. A discount for one section is left out.

A rotating section becomes a [rotating category](add-ons/rotating-shop/README.md#rotation) with its whole pool when the Rotating Shop add-on is installed, otherwise a normal category that shows every item. `frequency` becomes a cron schedule and wins over `interval`, which becomes a length; with neither it changes daily. `can-repeat`, `broadcast` and each item's `display-chance` are kept. It shows as many items as it had display slots across its pages, in the order of the category, so the slot positions are not kept.

Counts and transactions for items that are no longer in the shop files are left out. The plain text transaction log is not read.

## UltimateShop

Reads UltimateShop/shops, the main menu in menus/main.yml, and the language files for every `{lang:...}` reference. Everything becomes one shop called `ultimateshop`. A shop file's next-page button folds the next file into the same category.

<figure><img src=".gitbook/assets/migrations/ultimateshop.png" alt="" width="563"><figcaption><p>Migrations (Migrate from UltimateShop)</p></figcaption></figure>

Items keep their product, amount, name, lore, enchantments, stored enchantments, potion type and effects, head texture, leather colour, banner patterns, spawner mob, armor trim, item model and prices, including the shared prices and the general settings of the file. Its `display-item` is what the shop shows and its product what the player gets. Its `add-lore` lines are added to the shown lore. Buy, sell and give actions that run commands come across as commands, and a product with give actions is still given unless it has `give-item: false`. Such a product sells back only as the exact item. Permission conditions on the shop, the file or the item become conditions and requirements. Slots from the menu layout are not kept.

A `match-item` rule that only lists materials sells as the product's material, or the first listed, and `has-name: false` also requires an unnamed item. Any other rule, or a product that is no item at all, leaves the item buy-only. When an item lists several products or prices, the first money price is taken. In `ALL` and `CLASSIC_ALL` price modes, plain prices in one currency are added up; otherwise one is kept and the report says the item is cheaper now. Shared prices from its config.yml are resolved. A price paid in a plain item becomes an item currency on Premium. Prices written as a formula, paid in plugin items, or paid through a placeholder or commands are left out. A buy price of 0, or one that names nothing to pay, makes the item [free](main-features/items/edit-item.md#free). `exp` prices stay experience points and `levels` prices levels. CoinsEngine and ExcellentEconomy currencies keep their currency, other economy plugins are left on the shop's currency.

A global buy limit becomes stock, the default buy and sell limits become per-player limits, and `-1` stays unlimited. Products in one `shared-use-times` group get that group's limits and become one limit group, each with its own stock. A timed reset becomes a daily restock at its first time, or a restock that many days after selling out when it sets days. A timer reset becomes one shared refill clock, a cron reset its schedule, and the default reset in config.yml applies to items without one. Limits that depend on a condition are left out. How much each player has already bought and sold, and how much of the global stock is used, come across from its player data files or its database.

## ExcellentShop

Reads the virtual shops in ExcellentShop/virtual_shop/shops, both the single-file and the older folder layout, with nightcore's colour scheme and currencies. Everything becomes one shop called `excellentshop`. Each shop's main-menu icon name and description name its category, its main-menu slot orders it, its first alias becomes the category's command, and a required permission becomes `excellentshop.virtual.shop.<shop>`. A shop that turned buying or selling off keeps it off.

<figure><img src=".gitbook/assets/migrations/excellentshop.png" alt="" width="563"><figcaption><p>Migrations (Migrate from ExcellentShop)</p></figcaption></figure>

Products come across as the exact item, with every detail of the stack, and keep their prices and currency. nightcore colour names such as `<soft_green>` keep the colour they had on that server. Command products run their commands, `player:` ones as the player, and once per purchase unless they use `%amount%`. Items from Nexo, ItemsAdder, MMOItems, CraftEngine and ExecutableItems keep their plugin item. Required and forbidden permissions and ranks become requirements. Dynamic prices come across as their starting price, floating ones as the middle of their range. Global stock and per-player buy and sell limits come across with their restock time. The remaining stock and each player's purchases and sales in data.db come across too. Rotating products are left out, see the Rotating Shop add-on for those. Chest shops and the auction house are not read at all.

## QuickShop

Reads QuickShop-Hikari when it is there, otherwise the older QuickShop (Reremake), from its local database or from MySQL with the connection and table prefix in its config.yml. Each shop becomes a [player shop](main-features/player-shops/README.md) on the same container and sign, owned by the same player, and its sign is rewritten to ours. A shop whose sign or container already holds one of ours is left alone, so importing again only adds what is missing.

<figure><img src=".gitbook/assets/migrations/quickshop.png" alt="" width="563"><figcaption><p>Migrations (Migrate from QuickShop)</p></figcaption></figure>

| QuickShop shop | Becomes |
| --- | --- |
| Selling | Players buy from the chest, at the same price. |
| Buying | Players sell into the chest. |
| Frozen | Left out. Unfreeze it and import again. |
| Unlimited | An admin shop with endless stock, paying nobody. |
| Owned by the server | An admin shop when unlimited, otherwise left out. |

The item comes across as the exact stack. With stacking shops turned off, a shop trades one item at a time, as it did. Staff and administrators of a shop become its staff. A currency that is also set up here keeps that currency, any other becomes money. A shop with its display item turned off keeps it off. Shop names, profit sharing, blocked players and per-shop tax accounts are left out and counted in the report.

QuickShop-Hikari keeps its shops in an H2 database. Reading it needs the H2 driver, which is downloaded from Maven Central into libs/ the first time and checked against its published checksum. On a server without internet access, put `h2-2.1.214.jar` from Maven Central in that folder yourself. The database is copied before it is read, never opened in place. On Windows, QuickShop-Hikari locks it while running, so remove its jar and restart before importing there.

The sign is the empty or QuickShop sign on a side of the container, as QuickShop finds it. A shop in an unloaded chunk takes the first wall sign on its container when that chunk loads. Shops with no sign, or on any container other than a chest, trapped chest, barrel or shulker box, are left out. Purchase logs and offline notifications are not read.

## Shop (snowgears)

Reads every owner's shop file in Shop/Data, the admin shops and the older files named after the player, with the currency from its config.yml. Each shop becomes a [player shop](main-features/player-shops/README.md) on the same sign and container, owned by the same player. Signs in loaded chunks are rewritten to ours. A sign that already holds one of ours is left alone, so importing again only adds what is missing.

<figure><img src=".gitbook/assets/migrations/shop-snowgears.png" alt="" width="563"><figcaption><p>Migrations (Migrate from Shop (Migrate from Shop (snowgears))</p></figcaption></figure>

| Shop type | Becomes |
| --- | --- |
| `sell` | Players buy from the chest, at the same price for the same amount. |
| `buy` | Players sell into the chest. |
| `combo` | Both. The sell price is what players pay, the buy price what they get. |
| `barter` | Players buy, paying with the barter item. |
| `gamble` | Left out. |
| Admin shops | Admin shops with endless stock and no owner. |

A `VAULT` currency becomes money and `EXPERIENCE` becomes experience points. An `ITEM` currency, the default, makes every shop paid in that item, emerald unless it was changed, with prices as item counts. A trade amount above a stack comes across as it was. Display type `NONE` turns the shop's display off.

Shops on an ender chest or any other container than a chest, trapped chest, barrel or shulker box are left out. Offline purchase notifications and its transaction database are not read.

## ChestShop

ChestShop keeps its shops only on the signs, so the import reads the saved region files of every loaded world, without loading a chunk. Run `/save-all` first, or shops made since the last save are missed. Each sign becomes a [player shop](main-features/player-shops/README.md) on the same sign and the container ChestShop trades from, owned by the player its users.db names for the sign. A sign that already holds one of ours is left alone, so importing again only adds what is missing.

<figure><img src=".gitbook/assets/migrations/chestshop.png" alt="" width="563"><figcaption><p>Migrations (Migrate from ChestShop)</p></figcaption></figure>

| Sign | Becomes |
| --- | --- |
| `B` price | Players buy from the chest, at that price for the sign's amount. |
| `S` price | Players sell into the chest. |
| Both | Both, each at its own price. |
| `free` | A price of 0. |
| Amount above a stack, or a stock counter | The same amount. The counter is dropped. |
| Item name, shortened name, `:damage` or `#code` | The exact item, `#code` items with every detail from its items.db. Item aliases are followed. |
| Admin Shop | An admin shop with endless stock, even where it traded from its chest before. |

A container here holds one shop, so when several signs trade from one chest only the first comes across. Admin Shop signs with no chest beside them become admin shops that need no container. Signs whose owner its users.db does not know, unfinished `?` signs, and shops on a container other than a chest, trapped chest, barrel or shulker box are left out. Players who turned off their sale messages keep them off. Discounts, price limits and tax are not read.

## Essentials

Reads Essentials/worth.yml, and items.json for older item names. Everything becomes one sell-only shop called `essentials`, sorted into Tools, Armour, Ores, Food, Blocks and Other categories. When two entries name the same item, the one under its current name wins. Prices split by data value price each old variant, such as each sapling, and the `*` price covers the variants with none of their own. Entries that are not an item a player can hold, such as water and lava, are left out.

<figure><img src=".gitbook/assets/migrations/essentials.png" alt="" width="563"><figcaption><p>Migrations (Migrate from Essentials)</p></figcaption></figure>

Source: https://www.phoenixplugins.com/docs/phoenix-shop/migration