Skip to content

Vercel

With Coherence, it's easy to migrate your app from Vercel to AWS or GCP. You get the compliance, cost, customizability you want. And you can use your cloud credits too, especially if you're a startup. Coherence gives everything you loved on Vercel, like built-in CI/CD, Console access in the browser, and preview environments. And we add on some cool new tools like Workspaces and Velocity analytics.

Here's how you can migrate in just a few steps. In this example, we'll migrate an app using Neon from Vercel onto Google Cloud Platform. The app is based on this Vercel template: https://github.com/vercel/nextjs-postgres-nextauth-tailwindcss-template and reflects a complex SaaS app that uses a serverless postgres database in a Next.js app with react in order to deliver a great experience to users. Vercel also offers postgres which is a wrapper around Neon - the biggest difference is that you cannot use Vercel postgres outside the Vercel platform easily, so you'd need to migrate your data to Neon itself or to a cloud RDBMS like RDS or Cloud SQL. In the end, the right choice for your team is up to you, we'd love to help either way, and we've got lots of other examples on this docs site of using these systems as well. For migrating this app, where we'll stay with Neon directly, you can watch a video of this whole process right here.

Connect Coherence to Github and AWS/GCP

Go to the Coherence app, create an account, and create an application - following our simple onboarding flow. You'll do the following, see a full example here: - Add your app name and repo, choose your cnc flavor - Authorize your github repo

Configure your Coherence application

Set environment variables

Copy over any environment variables. You'll want to add the connection string from Neon as the right variable, e.g. DATABASE_URL. Adding at the collection level means all environments in that collection will automatically inherit that variable, making it easy to spin up a new environment without worrying about this. You can also override the value in each envionment if you need to.

Configure your first environment

Jult like Vercel, Coherence places a focus on developer experience and offers an easy UI to manage your environments and services. On the Environments tab, you'll add your first environment and configure the services you need. Create your first environment from the collection home screen.

first environment

Add services from the environment details services tab, or use cnc.yml directly. You can mix-and-match the two, of course.

add service

For example, here's a new backend service:

new backend service

or the corresponding cnc.yml that you can edit in the tab seen in the UI:

services:
  next:
    build:
      context: "."
    x-cnc:
      type: backend
    command: npm start

You can now also clone this environment into a new one with just a single click, like this:

clone environments

One common issue to check that we call out in our popular frameworks docs is the "Virtual Environments" or similar configuration for your language (e.g. venv for python or profile for ruby). You'll need to add this to the start of your command in the command when moving over from the Procfile. You can skip this step if you're writing your own Dockerfile - only applies if using nixpacks, which is our equivalent of Heroku's buildpacks.

Test your application, check out preview environments

Make sure your app works from end-to-end. You'll know best how to test your app but common things to check on the infra side are: static assets, database connections, workers/crons, and logging.

Migrate production, including any databases and DNS

This is the most complex and important part of the migration. Please get in touch with the Coherence team if you've got any questions - we're happy to help!

In general, here's the flow:

  • Schedule the DNS switch, warn users about possible downtime if you have an SLA. Do this at an off-hour if you can.
    • Set up custom domain in Coherence UI, add the records, switch in your DNS provider's UI
  • Test system end-to-end, the DNS switchover can take time across different networks and systems (read more here)
  • All done!