# How do I migrate away from `vercel.json` env and build.env?

**Author:** Sam Ko

---

This article will help you migrate your `vercel.json` environment variables (legacy method) to the [Environment Variables UI](https://vercel.com/docs/environment-variables).

## Migrate Your Environment Variables

You may have configured the [`env`](https://vercel.com/docs/configuration#project/env) and [`build.env`](https://vercel.com/docs/configuration#project/build-env) legacy properties in a `vercel.json` file:

`{ "env": { "MY_KEY": "this is the value", "SECRET": "@my-secret-name" }, "build": { "env": { "MY_KEY": "this is the value", "SECRET": "@my-secret-name" } } }`

We **no longer** recommend you use this legacy method for environment variables. Instead, we recommend you migrate your environment variables to the [Environment Variables UI](https://vercel.com/docs/environment-variables). Here is how to add the same envrionment variables setup to our Environment Variables UI using the example above:

Migrating to the Environment Variables UI will help you avoid errors when implementing your environment variables.

## Redeploy

Once you have successfully moved your environment variables to the [Environment Variables UI](https://vercel.com/docs/environment-variables), make sure to redeploy your [Vercel Project](https://vercel.com/docs/platform/projects) to reflect these new changes.

---

[View full KB sitemap](/kb/sitemap.md)
