Nhost is an open-source backend platform built on PostgreSQL and a GraphQL API. An Nhost project combines a Postgres database with authentication, file storage, and serverless functions.
How does the integration work?
Appwrite Migrations connects to your Nhost database and, with your project's admin secret, to its file storage, then copies their resources into an Appwrite project. You choose which resources to move in the migration wizard, and Appwrite runs the migration in the background.
| Resource | Migration |
|---|---|
| Users | Automatic |
| Databases | Automatic |
| Rows | Partial |
| Files | Automatic |
| Functions | Manual |
Appwrite Databases don't support every PostgreSQL feature, so advanced indexes, PostgreSQL functions, and scheduling are not migrated. Users who signed in with an OAuth provider need to sign in again after the migration, because their sessions belong to that provider. Nhost functions must be rewritten as Appwrite Functions because of syntax and runtime differences.
On Appwrite Cloud, resource usage during a migration doesn't count toward your usage charges. Nhost may still charge for data transfer.
How to implement
To migrate an Nhost project to Appwrite, there are several steps you must complete:
Step 1: Collect your Nhost credentials
Collect the following values from your Nhost project:
| Field | Where to find it |
|---|---|
| Region | The NHOST_REGION environment variable of your project. |
| Subdomain | The NHOST_SUBDOMAIN environment variable of your project. |
| Database | The database name in your project's Database settings. |
| Username | The database username in your project's Database settings. |
| Password | The database password you set when you created the project. Reset it in the Database settings if you no longer have it. |
| Admin Secret | The NHOST_ADMIN_SECRET environment variable of your project. Appwrite uses it to transfer your files. |
Step 2: Start the migration in Appwrite
For this step, you must create an account on Appwrite Cloud or self-host Appwrite if you haven't already.
Create a new project, open Project settings, and go to the Migrations tab. Click Create migration and select Nhost as the source. Enter the credentials from the previous step, click Next, select the resources to migrate, and click Start migration.
You can also start a migration from a Server SDK with createNHostMigration, using an API key with the migrations.write scope.
Step 3: Finish the move
Once the migration completes:
- Add your web, Flutter, Android, and iOS apps as platforms in your Appwrite project. Appwrite rejects requests from apps it doesn't know.
- Review the permissions on migrated resources so users can only reach their own data.
- Rewrite your Nhost functions on a supported Appwrite Functions runtime.
Read more about Nhost and Appwrite
If you would like to learn more about migrating from Nhost to Appwrite, we have some resources that you should visit:
