# Deploy not working

**URL:** <https://community.forestadmin.com/t/deploy-not-working/8006>\
**Category:** Help me!\
**Tags:** setup\
**Created:** [March 26, 2025, 8:58pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006 "2025-03-26T20:58:52Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janet\_Gilbert](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/janet_gilbert/32/7805_2.png) [@Janet\_Gilbert](https://community.forestadmin.com/u/Janet_Gilbert)\
**Post date:** [March 26, 2025, 8:58pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/1 "2025-03-26T20:58:52Z")

</div>

## Feature(s) impacted

I have set up a local development environment and am able to edit layout in it. I now want to deploy it to production. There seem to be several ways of doing this, and I’m a little confused about which to use.

If I try running “forest deploy” from the command line I get the error "Source and destination environments must have the same schema. "

I have updated the version of forest on the command line, so the development environment has a different version than the production environment. I’m not sure how to do it in the production environment.

If I try “npm run forestadmin:build:package:publish”

I get the error:  
× Failed to retrieve database schema from Forest Admin server: Request failed with status code 422  
🚨 Your environment is not a cloud environment.  
ERROR: “forestadmin:update-typings” exited with 1.  
ERROR: “build” exited with 1.

The documentation indicates that there should be a “deploy to production” link at the top of the page online. However this is not present for me.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/0/0de8f7a2477a8a8400ab320451af42a0f9758da2.png)

This is the contents of my env file:  
FOREST\_ENV\_SECRET=[redacted]  
TOKEN\_PATH=C:\Users\janet  
LOG\_LEVEL=Info  
APPLICATION\_URL=[http://localhost:3351](http://localhost:3351)  
APPLICATION\_PORT=3351

Should FOREST\_ENV\_SECRET be the production or development secret? I’ve tried both.

Here is the contents of my datasource.js

module.exports = () =\> ({  
main: {  
connectionOptions: {  
uri:“mongodb://localhost:27018/mongo”,  
},  
},  
})

## Observed behavior

See above

## Expected behavior

I’m just looking for any way to deploy to production.

- Project name: Cerebro 2
- Team name: Praxis Labs
- Environment name: Windoes
- Agent technology: (nodejs, php, rails, python): ?
- Agent (forest package) name & version: 1.61.0/1.60.0
- Database type: MongoDB
- Recent changes made on your end if any: successfully created development environment, no code changes.

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [March 27, 2025, 9:08am UTC](https://community.forestadmin.com/t/deploy-not-working/8006/2 "2025-03-27T09:08:17Z")

</div>

Hello again @Janet_Gilbert,

> If I try running “forest deploy” from the command line I get the error "Source and destination environments must have the same schema. "

The forest `deploy command` is not related to the Cloud code customization publication, could you tell me what might have caused this confusion, did you find something that suggested that this is the command that should be used ?

> If I try “npm run forestadmin:build:package:publish”  
> I get the error:  
> × Failed to retrieve database schema from Forest Admin server: Request failed with status code 422

That is indeed the proper command to publish your customization, the error tells me that you do not have the env\_secret of your production environment, which is the env\_secret that should be set.  
You should have pretty much everything you need to understand and work with a Cloud project from this modal

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/a/a3e280e4eb2ae4cba9adc303e5e5cd0b6acd8cb9.png)

> The documentation indicates that there should be a “deploy to production” link at the top of the page online. However this is not present for me.

I think you are referencing a page that is about layout customization, if you are exploring the documentation, we have a page [specific to Cloud environments](https://docs.forestadmin.com/cloud) which hopefully will be easier for you.

---

<div class="post-metadata">

**Author:** ![Janet\_Gilbert](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/janet_gilbert/32/7805_2.png) [@Janet\_Gilbert](https://community.forestadmin.com/u/Janet_Gilbert)\
**Post date:** [March 27, 2025, 1:13pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/3 "2025-03-27T13:13:46Z")

</div>

OK using the production secret worked for the code customizations. I haven’t actually customized any code yet: planning to today.

How do I deploy the layout customization that I have created in the development environment to the production environment? Your link does not say how to do this.

---

<div class="post-metadata">

**Author:** ![Janet\_Gilbert](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/janet_gilbert/32/7805_2.png) [@Janet\_Gilbert](https://community.forestadmin.com/u/Janet_Gilbert)\
**Post date:** [March 27, 2025, 1:15pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/4 "2025-03-27T13:15:41Z")

</div>

There is no link to deploy

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/7/715653b4020460cb828cb2fe82ef2af06e5d9e2d.png)

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [March 27, 2025, 1:46pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/5 "2025-03-27T13:46:30Z")

</div>

Sadly the feature to deploy layout customization from a development environment to production environment is not possible as of yet in a Cloud project.

---

<div class="post-metadata">

**Author:** ![Janet\_Gilbert](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/janet_gilbert/32/7805_2.png) [@Janet\_Gilbert](https://community.forestadmin.com/u/Janet_Gilbert)\
**Post date:** [March 27, 2025, 2:02pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/6 "2025-03-27T14:02:55Z")

</div>

OK then how do I achieve a workflow where I develop layout and code and test it on a test database? Does Forest Admin require you to develop and test layout on your live production database?

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [March 27, 2025, 4:06pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/7 "2025-03-27T16:06:43Z")

</div>

We are aware that this can be a pain, the plan is to tackle this at some point but I do not have an ETA to share.

What we suggest would be to ensure in your development environment that changes to your database/models and code customization works before deploying to production on which you would then be able to edit the layout according to the needs of your business.

However if you think this pain point is higher than the cost of hosting an agent yourself, you could chose to switch to a self-hosted project which has the DWO fully functioning.

---

<div class="post-metadata">

**Author:** ![Janet\_Gilbert](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/janet_gilbert/32/7805_2.png) [@Janet\_Gilbert](https://community.forestadmin.com/u/Janet_Gilbert)\
**Post date:** [March 28, 2025, 2:22pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/8 "2025-03-28T14:22:08Z")

</div>

Is there any documentation on this workflow? Can I synchronize UI changes from the Production environment to the development environment?

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [March 31, 2025, 12:24pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/9 "2025-03-31T12:24:22Z")

</div>

There is currently no documentation on this aspect for a Cloud project, as the development environment is fairly new in this kind of setup.

But for the UI changes from Production → Development, there should be no issue, any changes made in production will be reported to your development environment automatically. Your [layout branch](https://docs.forestadmin.com/developer-guide-agents-nodejs/deploying-to-production/using-branches#what-is-a-branch) in development is based on your production, you simply are not able to deploy layout changes from Dev → Prod

---

<div class="post-metadata">

**Author:** ![Janet\_Gilbert](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/janet_gilbert/32/7805_2.png) [@Janet\_Gilbert](https://community.forestadmin.com/u/Janet_Gilbert)\
**Post date:** [March 31, 2025, 1:02pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/10 "2025-03-31T13:02:06Z")

</div>

OK so I can develop the layout in Production and the code in Development?

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [March 31, 2025, 1:11pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/11 "2025-03-31T13:11:00Z")

</div>

Exactly 👍

Note that if you delete a model or code customization in development environment, the layout defined in production won’t be applied on your development environment.

---

<div class="post-metadata">

**Author:** ![Janet\_Gilbert](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/janet_gilbert/32/7805_2.png) [@Janet\_Gilbert](https://community.forestadmin.com/u/Janet_Gilbert)\
**Post date:** [March 31, 2025, 1:46pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/12 "2025-03-31T13:46:30Z")

</div>

Is there a way of getting round that limitation?

What workflow do developers typically use with Forest Admin?

---

<div class="post-metadata">

**Author:** ![anon7284711](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anon7284711](https://community.forestadmin.com/u/anon7284711)\
**Post date:** [March 31, 2025, 2:50pm UTC](https://community.forestadmin.com/t/deploy-not-working/8006/13 "2025-03-31T14:50:37Z")

</div>

> Note that if you delete a model or code customization in development environment, the layout defined in production won’t be applied on your development environment.

Sorry if it mislead you, the only part that isn’t applied is the one on a deleted component, everything else will work fine.

The addition of a development environment in a Cloud project is still somewhat recent, so we have not been prompted with such feedback before.
