Migrate to Nhost Config
Learn how to migrate old projects to use the new configuration file
migration config pull nhost.toml project linking configuration migrationIf you want to migrate an existing project you need to:
- Go into your project’s folder:
$ cd /path/to/existingproject- Login:
$ nhost login- email: david@nhost.io- password:AuthenticatingSuccessfully logged in, creating PATSuccessfully created PATStoring PAT for future user- Link your project:
$ nhost link
│ │ │ │ │ # │ Subdomain │ Project │ Workspace │ Region │ 1 │ lrkadqfanxgmscttabiv │ demo │ david-yirq │ eu-central-1 │ │ │ │ │ │- Select # the workspace to link: 1- Enter project subdomain to confirm: lrkadqfanxgmscttabiv- Pull the configuration from the cloud:
$ nhost config pull
- /path/to/existingproject/nhost/nhost.toml already exists. Do you want to overwrite it? [y/N] y- /path/to/existingproject/.secrets already exists. Do you want to overwrite it? [y/N] yPulling config from Nhost...Getting secrets list from Nhost...Adding .secrets to .gitignore...Success!- Review `nhost/nhost.toml` and make sure there are no secrets before you commit it to git.- Review `.secrets` file and set your development secrets- Review `.secrets` was added to .gitignore-
Follow the instructions on screen to ensure your configuration contains no secrets and you don’t commit sensitive information to git.
-
Profit:
$ nhost up
Verifying configuration...Configuration is valid!Setting up Nhost development environment...Starting Nhost development environment...[+] Running 11/11 ✔ Network existingproject_default Created 0.0s ✔ Container existingproject-minio-1 Healthy 13.9s ✔ Container existingproject-postgres-1 Healthy 13.9s ✔ Container existingproject-traefik-1 Healthy 13.9s ✔ Container existingproject-dashboard-1 Healthy 13.9s ✔ Container existingproject-mailhog-1 Healthy 13.9s ✔ Container existingproject-functions-1 Healthy 13.9s ✔ Container existingproject-graphql-1 Healthy 13.8s ✔ Container existingproject-console-1 Healthy 18.8s ✔ Container existingproject-storage-1 Healthy 13.8s ✔ Container existingproject-auth-1 Healthy 18.8sApplying migrations...INFO nothing to apply on database: defaultNhost development environment started.URLs:- Postgres: postgres://postgres:postgres@localhost:5432/postgres- Hasura: https://local.hasura.local.nhost.run- GraphQL: https://local.graphql.local.nhost.run- Auth: https://local.auth.local.nhost.run- Storage: https://local.storage.local.nhost.run- Functions: https://local.functions.local.nhost.run- Dashboard: https://local.dashboard.local.nhost.run- Mailhog: https://local.mailhog.local.nhost.runSDK Configuration: Subdomain: local Region: (empty)Run `nhost up` to reload the development environmentRun `nhost down` to stop the development environmentRun `nhost logs` to watch the logs