> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Migrate a Site Plugin Extension

## Article: Migrate a Site Plugin Extension

## Article Link: https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/migrate-an-app-from-legacy-cli/migrate-a-site-plugin-extension.md

## Article Content:

# Migrate a Site Plugin Extension

This guide explains how to add a site plugin extension to your new Wix CLI project as part of [migrating an app from the legacy Wix CLI](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/about-the-wix-cli.md).

## Folder structure

| Legacy | New |
|--------|-----|
| `src/site/plugins/<name>/plugin.json` | `src/extensions/site/plugins/<name>/<name>.extension.ts` |
| `src/site/plugins/<name>/plugin.tsx` | `src/extensions/site/plugins/<name>/<name>.tsx` |
| `src/site/plugins/<name>/panel.tsx` | `src/extensions/site/plugins/<name>/<name>.panel.tsx` |
| `src/site/plugins/<name>/plugin.module.css` | `src/extensions/site/plugins/<name>/<name>.module.css` |

## Step 1 | Move and rename files

To move existing files into the new project:

1. In the new project, create the folder `src/extensions/site/plugins/<name>/`.
2. Copy and rename the files:
   - `plugin.tsx` → `<name>.tsx`
   - `panel.tsx` → `<name>.panel.tsx`
   - `plugin.module.css` → `<name>.module.css` (if present)
3. Update import references in the `.tsx` files to use the new filenames.
4. Fix any other import paths in the `.tsx` files if needed, including imports of backend code.

Don't copy the old `plugin.json` file. It is replaced by a new `.extension.ts` file.

## Step 2 | Create the extension file

In `src/extensions/site/plugins/<name>/`, create `<name>.extension.ts`:

```ts
import { extensions } from '@wix/astro/builders';

export default extensions.sitePlugin({
  id: '<id-from-plugin.json>',
  name: '<name-from-plugin.json>',
  placements: [],
  installation: {
    autoAdd: false,
  },
  tagName: '<name>',
  element: './extensions/site/plugins/<name>/<name>.tsx',
  settings: './extensions/site/plugins/<name>/<name>.panel.tsx',
});
```

| Field | Source | Required |
|-------|--------|----------|
| `id` | `id` from `plugin.json` | Yes. Must match legacy value to preserve the extension. |
| `name` | `marketData.name` or `name` from `plugin.json` | Yes |
| `marketData` | `marketData` object from `plugin.json` | No |
| `placements` | `placements` from `plugin.json` | Yes. Use `[]` if not set. |
| `installation.autoAdd` | `installation.autoAddToSite` or `installation.autoAdd` from `plugin.json` | Yes. Use `false` if not set. |
| `tagName` | Use the extension folder name | Yes |
| `element` | Path to `<name>.tsx`, relative to `src/` | Yes |
| `settings` | Path to `<name>.panel.tsx`, relative to `src/` | Yes |

<blockquote class="important">

__Important:__
The `id` must match the value from the legacy `plugin.json`. Otherwise, the new entry is treated as a separate extension instead of a continuation of the legacy one.

</blockquote>

### Market data logo URLs

If the legacy `plugin.json` has a `marketData.logoUrl` that references a local `assets/` folder, replace it with `{{BASE_URL}}/site-plugin-logo.svg`:

```ts
marketData: {
  name: '<name>',
  logoUrl: '{{BASE_URL}}/site-plugin-logo.svg',
},
```

## Step 3 | Register the extension

In the new project, in `src/extensions.ts`, import the extension and add it with `.use()`:

```ts
import { app } from '@wix/astro/builders';
import mySitePlugin from './extensions/site/plugins/<name>/<name>.extension';

export default app().use(mySitePlugin);
```

## Step 4 | Return to the main migration guide

Return to the [Test, build, and release](https://dev.wix.com/docs/build-apps/develop-your-app/develop-an-app-with-the-cli/about-the-wix-cli.md#test-build-and-release) step in the main migration guide.