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

**URL:** <https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296>\
**Category:** Help me!\
**Created:** [May 15, 2023, 11:02am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296 "2023-05-15T11:02:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 15, 2023, 11:02am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/1 "2023-05-15T11:02:33Z")

</div>

## Feature(s) impacted

Field and smart Field update

## Observed behavior

A few fields added to a collection, currently working on local branch and environment (DEVELOPMENT) but not shown in remote environment (PRODUCTION).

The schema is updated and pushed to production servers, restart has already been made ofc,  
When running the “forest deploy” code, i can see the following error message :

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

When looking at “forest schema:diff” there is indeed some difference between both environment schema.

## Expected behavior

schema update and new fields being added to production environment

## Failure Logs

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

## Context

- Project name: Tandem
- Team name: Operations
- Environment name: Production
- Agent (forest package) name & version: @forestadmin/context , 1.31.0
- Database type: NoSQL (MongoDB)
- Recent changes made on your end if any: …

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [May 15, 2023, 1:44pm UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/2 "2023-05-15T13:44:18Z")

</div>

Hi @sadra_edrisaraki ,

The command `forest deploy` will apply your latest layout changes **definitively** to your reference environment (i.e production).  
For your forestadmin-schema.json, you will have to push it through your version control system that you are using.

Best regards,

Shohan

---

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 15, 2023, 1:52pm UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/3 "2023-05-15T13:52:49Z")

</div>

Hello, thx for the answer, as said in the topic, The schema is updated and pushed to production servers, it means, i have the exact same schema for production env in my codebase and version control system. Am i missing an information ?

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [May 15, 2023, 1:57pm UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/4 "2023-05-15T13:57:06Z")

</div>

I might have misunderstood this sentence :

> When looking at “forest schema:diff” there is indeed some difference between both environment schema.

Did you pushed your changes in the forestadmin-schema from your development folder to your production ?

---

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 15, 2023, 1:59pm UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/5 "2023-05-15T13:59:08Z")

</div>

No worries,  
yes i have double checked everything, the forest schema are identical in both env in my side  
i’ve heard about some schema push issue saturday and sunday, it might be related to this ? since i’ve tried to push changes sunday

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [May 15, 2023, 2:01pm UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/6 "2023-05-15T14:01:11Z")

</div>

Yes it is possible. Could you try to push your changes now to see if your issue persist ?

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [May 15, 2023, 2:03pm UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/7 "2023-05-15T14:03:08Z")

</div>

Another question on my end, what did you change in your schema ?

---

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 15, 2023, 2:06pm UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/8 "2023-05-15T14:06:47Z")

</div>

i just tried to push a small change and restart server but still no update.  
the changes i try to push are adding fields and Smart fields to a collection named users, “nbr of exchanges” is one of the smart field i try to add and “hasBecomePro” is one of the field i try to add

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [May 15, 2023, 3:04pm UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/9 "2023-05-15T15:04:05Z")

</div>

OK thanks for the information.  
They are indeed not in the production apimap.  
Can you confirm me that in the forestschema in your production folder, there are your new fields ?

---

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 15, 2023, 3:20pm UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/10 "2023-05-15T15:20:59Z")

</div>

sure ! here is a sample of the schema directly from the production server, they are identical to our local schema

![field](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/d/daa11f2ebb8a60c9636242b646fc6a6c6264faa4.png)

---

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 16, 2023, 9:35am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/12 "2023-05-16T09:35:46Z")

</div>

Hello, any news regarding the issue ? Our Team is kinda blocked by not being able to deploy changes

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [May 16, 2023, 9:58am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/13 "2023-05-16T09:58:38Z")

</div>

Hi @sadra_edrisaraki, do you still reproduce this issue below ?

> When running the “forest deploy” code, i can see the following error message :  
> Source and destination environments must have the same schema. Please check your environments code is synchronized.  
> When looking at “forest schema:diff” there is indeed some difference between both environment schema.

---

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 16, 2023, 10:03am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/14 "2023-05-16T10:03:21Z")

</div>

Hello, yes it’s still reproducing the same error

---

<div class="post-metadata">

**Author:** ![shohanr](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/shohanr/32/4999_2.png) [@shohanr](https://community.forestadmin.com/u/shohanr)\
**Post date:** [May 16, 2023, 10:15am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/15 "2023-05-16T10:15:00Z")

</div>

Could you please try to restart your agent in Production ? It should re-update the schema on our side

---

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 16, 2023, 10:33am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/16 "2023-05-16T10:33:34Z")

</div>

agent just restarted 👍

---

<div class="post-metadata">

**Author:** ![Alban\_Bertolini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/alban_bertolini/32/1077_2.png) [@Alban\_Bertolini](https://community.forestadmin.com/u/Alban_Bertolini)\
**Post date:** [May 16, 2023, 10:55am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/17 "2023-05-16T10:55:49Z")

</div>

Hello,  
Does the `forest deploy` work now?

---

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 16, 2023, 11:07am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/18 "2023-05-16T11:07:16Z")

</div>

nope, the forest deploy doesn’t work

 ![deploy](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/7/748bb00d30c4c4c6a767528c803248a842dc7e2b.png)

---

<div class="post-metadata">

**Author:** ![Alban\_Bertolini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/alban_bertolini/32/1077_2.png) [@Alban\_Bertolini](https://community.forestadmin.com/u/Alban_Bertolini)\
**Post date:** [May 16, 2023, 11:15am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/19 "2023-05-16T11:15:05Z")

</div>

It’s very weird. Your production schema has been updated for the last time the 14/05/2023 19:07:05.  
Can you look your log when you are restarting your production agent and tell me if there is a log that displays “Schema was updated, sending new version” ?

---

<div class="post-metadata">

**Author:** ![sadra\_edrisaraki](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sadra_edrisaraki/32/6103_2.png) [@sadra\_edrisaraki](https://community.forestadmin.com/u/sadra_edrisaraki)\
**Post date:** [May 16, 2023, 11:30am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/20 "2023-05-16T11:30:22Z")

</div>

Yes indeed the last time the schema has been updated is 14/05/2023 19:07:05, unfortunatly, we don’t store logs of forest admin output, i can try to modify the schema again right now and see if there is the “Schema was updated, sending new version” log

---

<div class="post-metadata">

**Author:** ![Alban\_Bertolini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/alban_bertolini/32/1077_2.png) [@Alban\_Bertolini](https://community.forestadmin.com/u/Alban_Bertolini)\
**Post date:** [May 16, 2023, 11:34am UTC](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296/21 "2023-05-16T11:34:11Z")

</div>

Is it working? I saw a request from you side.

[Next page](https://community.forestadmin.com/t/source-and-destination-environments-must-have-the-same-schema-please-check-your-environments-code-is-synchronized/6296.md?page=2)
