How can I deploy a connected app from my sandbox environment to my production environment?

One organization acts as the "host" of the connected app. All other orgs will automatically "install" it on the first use in that org. There's no need to package it up or deploy it anywhere. If you were to create it in every other org, you'd have unique client ID and client secret values, which would be disastrous at best. I would say you should create your Connected App in a permanent org (production or a DE org), rather than a Sandbox, which could be destroyed, coincidentally deleting the Connected App.


the refresh from PROD to Sandbox - destroys any prior existing Connected app, also from prod - new sandbox wont get created on sandbox either (either with partial copy from prod or from full refresh from prod).

this is a bit of limitation or constraint for us.

it wont even allows to create new connected app on sandbox with same API name ! this makes things more complicated. everytime we need to create new API name and change all related classes / pages to point to new API name !