Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Melissa/log 728 heroku migration doc #348

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/data/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,10 @@ export const sidebarContent: ISidebarContent = [
makePage("Compare to Heroku", "reference"),
],
},
{
title: "Guides",
pages: [
makePage("Migrate from Heroku", 'guides')
]
},
];
104 changes: 104 additions & 0 deletions src/docs/guides/migrate-from-heroku.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: Migrate from Heroku
---

Migrating your app from Heroku to Railway is very simple. We even support Procfiles out of the box. (Only a single process is supported for now).

All you need to do is create a project in Railway, push your code, and migrate your envionment variables.

This guide will step you through the process of migrating a simple web service, using the [Railway CLI](/develop/cli).

<Image src="https://res.cloudinary.com/railway/image/upload/v1695765903/docs/heroku-migration/intro1_uauodg.gif"
alt="Screenshot of Railway Up"
layout="intrinsic"
width={700} height={464} quality={80} />

## Working Directory

In your terminal, ensure your current working directory is the same directory where your service code is located.

This is important so that as you complete the following steps, the [Railway CLI](/develop/cli) is properly linked.

## Login to Railway from the CLI

Ensure your CLI is authenticated to your Railway account:
```bash
railway login
```

This command will prompt to open a browser to complete authentication. Once authenticated, commands executed by the Railway CLI, will be performed in the context of your Railway account.

## Create a New Project

Now, let's create a new [project](develop/projects):
```bash
railway init
```

This command will prompt you to define a name for your service.


## Deploy the Service

Once your project is created, you can push your code into the project and assign a domain.

### Push the Code

Push the code into a [service](/develop/services) in Railway:
```bash
railway up -d
```

At this point, the service is being deployed, but let's give it a domain.

### Assign a Domain

The service we are migrating is a web service that should be available over the Internet, so let's assign a domain:
```bash
railway domain
```

Now the service will be available over the Internet via the provided domain.

## Migrate the Environment Variables

Finally, we will import the environment variables from Heroku into Railway.

<Image src="https://res.cloudinary.com/railway/image/upload/v1695765481/docs/heroku-migration/variables_hagopv.gif"
alt="Video of importing variables from Heroku"
layout="intrinsic"
width={600} height={364} quality={80} />

### Open the Project in Railway

Let's pop over to our new project in the [Railway canvas](/develop/projects).:
```bash
railway open
```

This will open the project in your browser.

### Add Heroku Variables to the Service

From the project canvas, import the Heroku variables into the service:
- click on the service
- click `Variables` tab
- open the command palette using `CMD + K` or `Ctrl + K`.
- search for `Import variables from Heroku`
- confirm the Heroku service and hit `Enter`

Your Heroku variables will be imported into the service, and it will automatically redeploy.

_Note: The first time you import variables from Heroku, you will be prompted to Allow Railway to connect to your Heroku account._

## Conclusion

Following this guide, we have successfully migrated a simple web service from Heroku to Railway, including importing variables from Heroku into Railway.

We have completed the migration by pushing our code directly from our local machine into a service in Railway. Once you are comfortable with Railway, you may want to integrate [deployments](/deploy/deployments) into your development workflow.

For more advanced operations, like migrating your databases from Heroku to Railway, the process will be a bit more involved, but we are happy to help work out a solution!

## Need Help?

If you run into any issues, or would like help with your migrations, we would be more than happy to answer your questions on our [Discord](https://discord.gg/railway) or over email at [team@railway.app](mailto:team@railway.app).
12 changes: 1 addition & 11 deletions src/docs/reference/compare-to-heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,4 @@ We feel no project, big or small- is never not important. This is our guiding ph

As a result, we make great pains to be very communicative in our support channels, [optimistically gather feedback](https://feedback.railway.app/), provide informative docs, and encourage our community to help each other.

Having an issue with a deployment? [Join over 5k Railway users on our Discord Server!](https://discord.gg/railway) With our dedicated support channels, you can get help from the Railway team and our community of builders.

## Moving From Heroku to Railway

Getting your app hosted on Heroku moved over to Railway is very simple.

All you need to do is connect your GitHub account, create a new project, and then deploy your repo. We even support Procfiles out of the box. (Only a single process is supported for now)

If you want to learn in-depth about our product, the [Getting Started guide](/getting-started) that will walk you through the process.

If you run into any issues, we would be more than happy to answer your questions on our [Discord](https://discord.gg/railway) or over email at team@railway.app
Having an issue with a deployment? [Join over 5k Railway users on our Discord Server!](https://discord.gg/railway) With our dedicated support channels, you can get help from the Railway team and our community of builders.