# Updating to a New Version

> How to apply a new Seedly Sites release to your instance - the update helper, database migrations, and redeploying safely.

When a new version of Seedly Sites ships, you do not `git pull`. Your copy is a clean download with no vendor remote. Instead you apply the new code with the update helper, which keeps your settings and customizations, then run any database migrations the new version needs.

---

## Before You Start

- **Back up Postgres.** A version bump can include a database migration. Take a dump first ([Backups](/docs/help/backups)).
- **Read the release notes.** Know your current version and the target version, and look for anything called out as manual. The [Changelog](/docs/changelog) lists what changed.

---

## Step 1: Preview the Update

The update helper supports a dry run so you can see what it would change without touching anything:

```
npx pnpm run update -- --dry-run
```

Read the plan. The helper preserves your environment files, your git history, and files you customized, and overlays the new product code.

## Step 2: Apply the Update

```
npx pnpm run update
```

Then reinstall dependencies, since the update may have changed them:

```
npx pnpm install
```

## Step 3: Run Database Migrations

A Postgres-backed platform can require schema changes that a code overlay alone does not apply. The update helper surfaces a migration checklist; do not skip it. Run the committed migrations:

```
npx pnpm --filter @seedly-sites/cms migrate
```

Migrations run against your production database, so treat this like any production action: back up first, and read what it will do. If the release notes list a specific order, follow it exactly.

> Skipping this step is the most common update mistake. If the admin errors about the database right after an update, the migration is almost always what is missing.

## Step 4: Redeploy the Services

1. Commit the updated code on a branch, open a pull request, and merge to `main`. Railway rebuilds the cms and pagebuilder services from `main`.
2. Watch the cms service come back healthy.
3. **Client sites do not auto-update.** A code update rebuilds no tenant. Deploy any site whose live output should reflect the new version ([Deploying](/docs/help/deploying)).

## Step 5: Verify

```
npx pnpm run setup:check -- --target=prod
```

Confirm READY, then spot-check the admin and one or two live sites.

---

## Never Do These

- Never run `provision` against an already-live instance. Provisioning is fresh-instance only and refuses a non-fresh one for good reason.
- Never rotate the platform's session-signing secret as part of an update unless the release notes say to; it signs everyone out and invalidates signed tokens.
- Never apply a migration to production without a current backup in hand.

---
Source: https://seedlysites.com/docs/help/updates
