# How to deploy to environment after updating local schema?

**URL:** <https://community.forestadmin.com/t/how-to-deploy-to-environment-after-updating-local-schema/4968>\
**Category:** Help me!\
**Created:** [July 15, 2022, 7:46am UTC](https://community.forestadmin.com/t/how-to-deploy-to-environment-after-updating-local-schema/4968 "2022-07-15T07:46:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![winston0410](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/winston0410/32/4788_2.png) [@winston0410](https://community.forestadmin.com/u/winston0410)\
**Post date:** [July 15, 2022, 7:46am UTC](https://community.forestadmin.com/t/how-to-deploy-to-environment-after-updating-local-schema/4968/1 "2022-07-15T07:46:54Z")

</div>

> ⚠ **This is a template you must use to report issues**. ⚠  
> You can also drag images, videos and include `Preformatted text`.

## Feature(s) impacted

Deployment and schema update

## Observed behavior

After updating the schema and running the following commands, it returns the following error:

```sh
npx forest-cli@latest schema:update
npx forest-cli@latest deploy Development -p xxxxx

× Source and destination environments must have the same schema. Please check your environments code is synchronized.

```

## Expected behavior

I expect `forest deploy` can push update after changing the schema

## Failure Logs

> In this _optional section_, please:
> 
> - include any relevant log snippets if necessary,
> - or remove this section if left empty.

## Context

> Please provide in this **mandatory section** , the relevant information about your configuration:

- Project name: AdminConsole
- Team name: LevaClinic
- Environment name: Development
- Agent type & version: N/A
- Recent changes made on your end if any: …

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [July 15, 2022, 9:37am UTC](https://community.forestadmin.com/t/how-to-deploy-to-environment-after-updating-local-schema/4968/2 "2022-07-15T09:37:47Z")

</div>

Hi @winston0410 !  
Just to clarify a few things:

- The `schema:update` command allows you to [update your forest files](https://docs.forestadmin.com/documentation/how-tos/maintain/update-your-models-definition#examples) (the models, routes etc.) based on the changes that you made in your database. The `forestadmin-schema.json is computed when you start your server.
- The `deploy` command allows you [to push changes made to your layout](https://docs.forestadmin.com/documentation/reference-guide/how-it-works/developing-on-forest-admin/forest-cli-commands/deploy) (UI Customization) changes to another environment on ForestAdmin.

To update the forestadmin-schema.json on a production environment you need to copy the right version as there is no computation of the schema in prod.

If this doesn’t help you, could you tell me more about what youa re trying to achieve ?

---

<div class="post-metadata">

**Author:** ![winston0410](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/winston0410/32/4788_2.png) [@winston0410](https://community.forestadmin.com/u/winston0410)\
**Post date:** [July 15, 2022, 10:11am UTC](https://community.forestadmin.com/t/how-to-deploy-to-environment-after-updating-local-schema/4968/3 "2022-07-15T10:11:50Z")

</div>

I just want to update the change I have from local to the remote, as I have added some smart actions, I have run the following commands already but no luck at all:

```nohighlight
npx forest-cli@latest schema:update # This is fine. 
npx forest-cli@latest schema:apply # I am running this because I hit error 'Source and destination environments must have the same schema. Please check your environments code is synchronized.' when I run `forest deploy`
npx forest-cli@latest deploy Development # And then I hit the error here

```

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [July 15, 2022, 10:40am UTC](https://community.forestadmin.com/t/how-to-deploy-to-environment-after-updating-local-schema/4968/4 "2022-07-15T10:40:09Z")

</div>

I checked your schemas on dev and prod, and they are not the same, therefore you can’t deploy your layout changes to production. Can you push your changes to your production server and try again ?
