# Migrating an Elixir app from Heroku to Fly.io using fly.io/launch/heroku

**URL:** <https://community.fly.io/t/migrating-an-elixir-app-from-heroku-to-fly-io-using-fly-io-launch-heroku/5965>\
**Category:** Questions / Help\
**Tags:** elixir, postgres\
**Created:** [July 12, 2022, 7:20am UTC](https://community.fly.io/t/migrating-an-elixir-app-from-heroku-to-fly-io-using-fly-io-launch-heroku/5965 "2022-07-12T07:20:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lubien](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/lubien/32/41919_2.png) [@lubien](https://community.fly.io/u/lubien)\
**Post date:** [July 12, 2022, 11:35am UTC](https://community.fly.io/t/migrating-an-elixir-app-from-heroku-to-fly-io-using-fly-io-launch-heroku/5965/2 "2022-07-12T11:35:29Z")

</div>

> [@janjakubek](#):
>
> I now have two separate applications with a separate database and everything needed, but they communicate with each other. I am correct?

What actually happened is that Turboku created an app on [Fly.io](http://Fly.io) that will be synced with Heroku via webhooks but we don’t create/migrate databases and other services such as Redis immediately what you would have is an environment variable called DATABASE\_URL on both [Fly.io](http://Fly.io) and Heroku and both values point to the same place (where you host your DB), ditto for Redis and other addons.

When you deploy to Heroku we will pick the updated app there and deploy to [Fly.io](http://Fly.io) again.

> [@janjakubek](#):
>
> what steps do I need to take to completely break the connection between the apps and have each run independently of the other.

The first step would be removing the webhook from your Heroku app so [Fly.io](http://Fly.io) stop getting updates from your Heroku app, doing this make these apps two different entities.

Since you’re using elixir we have a `fly launch` CLI command that does all you need to deploy a new app and create databases, I’d recommend trying. The downside of this is that you’d need to create a new app and delete the old one which should be fine if the other app is not your production one and app names won’t matter if you have custom domains.

In case you want to create the database manually one user created a step-by-step migration guide:

> [@Migrating from Heroku Postgres to Fly Postgres: A Complete Guide](https://community.fly.io/t/migrating-from-heroku-postgres-to-fly-postgres-a-complete-guide/4262):
>
> Hi everyone, We recently successfully migrated away from Heroku Postgres to Fly Postgres. Here are the steps, start to finish: Setup Migrating Database Updating Connection Options Updating Deployment Migrations Accessing locally Setting up pg\_stats Setting up grafana Setting up pg-hero Setup To create your postgres database, run the following command. Make sure you update all values appropriately. Keep the initial cluster at 1 fly pg create --name your\_db --organization your-org --region y…

As for services such as Redis, you can deploy other apps just for it so you can take benefit of our internal DNS. Say your redis app is named `my-redis` you can just put on your main app that the host of your redis is `my-redis.internal`. [Read more](https://fly.io/docs/reference/private-networking/#discovering-apps-through-dns-on-a-wireguard-connection)

Hopefully this will help!

tl;dr:

1. Remove Heroku app webhook
2. Create database
3. Deploy additional services

---

_[View the full topic](https://community.fly.io/t/migrating-an-elixir-app-from-heroku-to-fly-io-using-fly-io-launch-heroku/5965)._
