# Updating and moving from the built-in plugins

> Update Anasaki Studio safely, pin a version, add the Site Code database to a site installed earlier, and what happens to the former built-in plugins when upgrading to 2.0

Source: https://anasaki.live/docs/en/studio/upgrade

## A normal update

1. Always back up first — [Export / import](/docs/en/studio/export-import) or a copy of the Docker volumes
2. In the folder with `docker-compose.yml`, run:
    0 
3. Open the admin and check the number under **Site settings → General → System version**

All data lives in volumes, so nothing is lost; the database structure is updated automatically on start.

### Pinning a version

A live site should pin a version instead of `latest` and move up when you are ready:

```ini
STUDIO_IMAGE=chichat/anasaki-studio:2.0.5
```

Tags: `X.Y.Z` (e.g. `2.0.5`), `X.Y` (`2.0` = the latest patch of 2.0), `X` and `latest`. Pre-releases such as `2.1.0-rc.1` never become `latest`.

> [!NOTE]
> Some plugins need a minimum system version (`minCore`). On an older system they cannot be installed, and the Store shows &#34;Requires system vX+&#34;.

## Sites installed before the Site Code database

The current `docker-compose.yml` needs `CODE_DB_PASSWORD`, and the script `docker/mysql-init/10-site-code.sh` runs only while the database volume is empty (a new install). A site installed earlier creates the database once by hand:

1. Download the new `docker-compose.yml` and `docker/mysql-init/10-site-code.sh` (keep your `.env`) — the commands are in [Getting started](/docs/en/studio/getting-started)
2. Add to `.env`:
    2 
3. Open MySQL as root and run the statements below (with the same password as `CODE_DB_PASSWORD`)
    3 
    4 
4. `docker compose pull && docker compose up -d`

> [!NOTE]
> Until then Site Code runs in &#34;fallback mode&#34; (its tables live in the CMS database, prefixed `sc_`). **Site Code → Database** shows these SQL statements with your database name, ready to copy. See [The Site Code database](/docs/en/developers/database).

## Upgrading to 2.0: the built-in plugins moved to the Plugin Store

Since 2.0 nothing is built in any more: the 7 former features are **official plugins** installed from the Plugin Store, and &#34;Backup&#34; became the built-in [Export / import](/docs/en/studio/export-import).

| Former plugin | Official plugin (id) |
| --- | --- |
| Visitor statistics | `analytics` |
| SEO + sitemap | `seo` |
| Contact forms | `forms` |
| Redirects + 404 log | `redirects` |
| Cookie consent | `cookie-consent` |
| Maintenance mode | `maintenance` |
| Custom code | `custom-code` |

### The automatic move

When the new version starts (and every minute after), the system looks for former plugins that were **switched on** or **still have data**, and handles them one by one:

1. Downloads the official plugin from the Store and checks it really is the official one
2. Installs and activates it, approving the permissions on the administrator's behalf — recorded as &#34;permissions approved by the automatic move&#34; with the time and the list
3. Copies the settings (same names) and moves the old data, such as forms and submissions (keeping their numbers, so pages with a form block keep working), redirect rules, per-page SEO and statistics
4. A former plugin that was **switched off** but has data is installed and its data moved, but it stays off

While a move is pending, the admin shows **&#34;N plugins are waiting to move to official plugins&#34;**; that feature is off for the moment but the site works normally.

### If a move fails

- It retries by itself (after 1, 2, 4 … minutes, at most hourly), or press **Try again**
- A site that cannot reach the Store: download the official plugin's `.zip` from the Plugin Store website and press **Upload a zip instead**
- See each one's status under **Plugins → Installed** in &#34;Moving from the former built-in plugins&#34;

### Cleaning up old data

Old data is **never deleted automatically**. Once you have checked that the official plugin works, press **Clean up old data** on it to delete the former built-in's tables and settings (the official plugin's data is not affected).

> [!WARNING]
> &#34;Clean up old data&#34; cannot be undone — back up first, and it is available only after the move has finished.

> [!NOTE]
> Bypass links of the former maintenance mode stop working after the move; testers open the bypass link again.

## Notes for later versions

- **2.3.0** — the admin keeps its session in an `HttpOnly` cookie: everyone signs in again once after updating. Saving a published page in the designer keeps a draft until you press Publish.
- **2.4.0** — packages from the official Plugin Store are signed and checked before install; nothing to set up. There is a new **Activity log** for administrators.
