> ## Documentation Index
> Fetch the complete documentation index at: https://deployz.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy an update

> Deploy a new release to a customer's deployment, and what happens if the update fails.

Deploy an update to move a customer's deployment to a different release of your application. Your customer doesn't need to do anything. The application keeps serving its current release until the new one passes its health checks.

## Before you start

* The release you want to deploy must have built successfully. See [Create a release](https://deployz.dev/docs/releases/create.md).
* The deployment must be installed, its Deployz connector must be **Online**, and no other operation can be running on it. See [When an update is unavailable](#when-an-update-is-unavailable).
* If the release adds infrastructure, such as a database, a cache, or a new worker, it can't go to an existing deployment. See [Changes that need a new deployment](#changes-that-need-a-new-deployment).

> [!WARNING]
>
> If your application has a separate migration step, the update runs it before any service changes. A migration that succeeded stays applied, even if the rest of the update fails, and rolling back doesn't reverse it. A retried update can run the migration again. Make your migrations safe to run more than once and compatible with the previous release. See [Keep migrations safe for rollback](https://deployz.dev/docs/prepare/migrations.md#keep-migrations-safe-for-rollback).

## Deploy the update

**Who:** you (the vendor), in the Deployz dashboard.

1. In **Deployments**, open the customer's deployment.
2. Select **Deploy update**. When a newer release is ready, the button reads **Deploy update to `<version>`**. After a failed update, it reads **Retry update** and opens the same release picker, so you choose the release again.
3. In **Release to deploy**, select the release (the field reads **Select a release** until you choose). The list shows releases that built successfully, newest first, except the one already running.
4. Check the summary. **Current release** and **New release** show the two versions. If the application now needs infrastructure this deployment doesn't have, the dialog shows **This release cannot be deployed here** and **Deploy update** stays disabled. See [Changes that need a new deployment](#changes-that-need-a-new-deployment).
5. Select **Deploy update**.

The dialog notes that the current release keeps serving until the new release passes its health checks, and that data is kept.

The deployment changes to **Updating**, and the detail page shows **Updating your application** with the running job and how long it has taken. **Recent activity** records each step.

To deploy updates from your CI pipeline instead, see [Build and deploy from your pipeline](https://deployz.dev/docs/api/pipeline.md).

## What happens during an update

1. **The database migration runs first.** If your application has a separate migration step, Deployz runs it after the infrastructure and database are ready and before any service changes. The migration must finish with exit code `0`. **Retry update** starts a new update, so a migration that succeeded in a failed attempt runs again. See [When a migration runs again](https://deployz.dev/docs/prepare/migrations.md#when-a-migration-runs-again).
2. **Each service moves to the new release.** Your current release keeps serving until the new one is running.
3. **The connector verifies the new release.** The update succeeds only when the connector confirms that the new release is running and healthy. See [Deployment status and health](https://deployz.dev/docs/operate/deployment-status.md).

An update changes only the release. The deployment's configuration stays as it is. If your application has scheduled jobs (**Preview**), they move to the new release only after the update succeeds.

An update keeps the container port and health check path the deployment was created with. Changes to those settings on the application apply only to new deployments. If you saved a different migration command on the application, the update uses it. If you select **Reset to detected** for the migration command, the deployment goes back to the command it was created with. See [Database migrations](https://deployz.dev/docs/prepare/migrations.md).

![Deploying an update. You select Deploy update. If the application has a separate migration step, Deployz first runs the database migration as a one-off task; it must exit with code 0. Then each service moves to the new release while the current release keeps serving. Then the connector verifies that the new release is running and healthy, and the deployment is live on the new release. If the migration fails, no service changes and the previous release keeps serving. If the rollout or verification fails, the previous release stays live, and a migration that already ran stays applied. Either failure shows Update failed.](https://mintcdn.com/deployz/nc75CAXckUHn4GYF/images/diagrams/update-flow.svg?fit=max\&auto=format\&n=nc75CAXckUHn4GYF\&q=85\&s=e4e8aba29b96a939f26720b20b3e6de9)

![Deploying an update. You select Deploy update. If the application has a separate migration step, Deployz first runs the database migration as a one-off task; it must exit with code 0. Then each service moves to the new release while the current release keeps serving. Then the connector verifies that the new release is running and healthy, and the deployment is live on the new release. If the migration fails, no service changes and the previous release keeps serving. If the rollout or verification fails, the previous release stays live, and a migration that already ran stays applied. Either failure shows Update failed.](https://mintcdn.com/deployz/nc75CAXckUHn4GYF/images/diagrams/update-flow-mobile.svg?fit=max\&auto=format\&n=nc75CAXckUHn4GYF\&q=85\&s=d8aae140a6ce056d238dd33fcd648084)

An update moves forward only after each step succeeds. A failure leaves the previous release serving.

## If the update fails

A failed update never takes down the release that was running. The deployment returns to its previous status, and:

* The **Deployments** list shows **Update failed**.
* The detail page shows **Update failed** with a line such as **Release `<version>` is still live and unaffected.**
* If the migration failed, no service was changed, and the previous release keeps serving.

The recovery panel on the detail page explains what failed and what to do next. Fix the cause, then select **Retry update**, or deploy a different release. See [Find your problem](https://deployz.dev/docs/troubleshooting/overview.md) and [Failure codes](https://deployz.dev/docs/reference/failure-codes.md).

## When an update is unavailable

When **Deploy update** isn't available, the detail page shows the reason under the action buttons. The same rules apply to **Rollback**, **Restart**, and **Configuration**.

| Reason | What to do |
| - | - |
| The deployment was removed, or is being removed. | Nothing. These actions no longer apply. |
| The deployment hasn't completed an install yet. The page says **Updates, restarts and rollbacks are available after the first install.** | Wait for the install to finish. If the first install failed, use **Retry install** instead. See [Fix install failures](https://deployz.dev/docs/troubleshooting/install.md). |
| No connector has connected yet, or the connector is offline. | Ask your customer to reconnect the connector. See [Reconnect or update the Deployz connector](https://deployz.dev/docs/operate/connector.md). |
| Another operation is running. The page says **Other actions are available after the `<operation>` finishes.** | Wait for it to finish. Only one update, rollback, restart, configuration change, or removal runs at a time. |
| The installed connector doesn't support the action. | Ask your customer to update the connector. See [Reconnect or update the Deployz connector](https://deployz.dev/docs/operate/connector.md). |

If you start an update and Deployz refuses it, the dialog shows why. For example, a release whose build is no longer available can't be deployed. Create a new release instead.

## Changes that need a new deployment

A deployment keeps the infrastructure it was created with. An update can't add or change infrastructure, so Deployz refuses an update when the application now needs any of these and the deployment doesn't have it:

* A database, or a different database engine
* A cache
* A different set of processes, such as workers
* A different set of queues (**Preview**)
* A different set of scheduled jobs (**Preview**)

The update dialog stops you first. It shows **This release cannot be deployed here**, lists the infrastructure the deployment is missing, and disables **Deploy update**. To apply the change, create a new deployment for the customer, or change the application's requirements back.

An application that no longer uses its database or cache can still be updated. The unused resource stays in the deployment.

Region and size also can't change on an existing deployment. See [Sizes and AWS cost](https://deployz.dev/docs/share/sizes-and-cost.md) and [AWS Regions](https://deployz.dev/docs/share/regions.md).

> [!NOTE]
>
> If you add a migration command to an application whose deployment was created without a separate migration step, Deployz refuses the update. Choose **No separate migration** for the application, or create a new deployment.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.