How to transfer your projects to Appwrite in one click
Tags: javascript, tutorial, productivity, opensource
Published: 2023-10-17 10:49:39

Transferring projects using one click typically refers to moving digital projects—such as websites, applications, databases, or other software-related assets—seamlessly and with minimal manual intervention from one hosting environment to another. It's a standard process companies and engineering teams adopt when switching hosting providers, upgrading infrastructure, or deploying projects to different environments—a process that is useful in any step of the project from development to production.

The term "one-click" implies that migration can be initiated with a few actions, simplifying what can otherwise be a complex and time-consuming process. Migrations are often facilitated by specialized tools, services, or scripts that automate the transfer of files, databases, configurations, and other components.

## Technology overview
[Migration](https://appwrite.io/docs/advanced/migrations?utm_source=hackmamba&utm_medium=hackmamba-blog) in Appwrite can help you migrate existing projects and move quickly to Appwrite. You can move your app from Firebase, Supabase, and Nhost and even between self-hosted and cloud projects using Migrations. You can also use Migrations to move between two self-hosted instances or duplicate projects on the same instance. Migrations will automatically move accounts, database documents, and storage files from one source to another.

[Appwrite Cloud](https://cloud.appwrite.io/?utm_source=hackmamba&utm_medium=hackmamba-blog) is an extension of the open-source version of Appwrite. It comes with all the services included in the open-source version but now has a fully managed service and minimum friction.

## Project overview
This article will discuss migrating an existing Next.js and Supabase project that stores products in the Supabase database to the Appwrite cloud database.

## GitHub
Check out the complete source code [here](https://github.com/Tundesamson26/appwrite-supabase-migration).

## Prerequisites 
To follow along with this tutorial, you should have a working knowledge of the following:
- Basic understanding of JavaScript 
- An Appwrite Cloud account; you can sign up for one [here](https://cloud.appwrite.io/?utm_source=hackmamba&utm_medium=hackmamba-blog)
- A Supabase project; you can create one [here](https://supabase.com/?utm_source=hackmamba&utm_medium=hackmamba-blog)

## Setting up the product application
To set up your application, you'll clone this [repository](https://github.com/Tundesamson26/appwrite-supabase-migration) using the command below:

```js
git clone <repo-git-url>
```

Then, run the command below in the project directory:

```js
$ cd <project-directory>
$ npm install
```
This repository contains all the initial setups you'll need for your app, helping you focus on your app's main functionality.

Then, run the development server using the command below:

```js
npm run dev
```

Once the development server runs, you can view it on your browser at [http://localhost:3000](http://localhost:3000/).

> **Note:** You may run into some errors if you run the app as it is. This means you have to manually set your supabase project configuration and get the required credentials like the `Endpoint` and `API Keys`.

The product catalog app should look like this:

![application-interface](https://paper-attachments.dropboxusercontent.com/s_1B57EA89652AF2B21132DEEEF77C4F993DC010B6520EAE2EEC76AFD70BFFE211_1696030045325_image.png)

## Migrating your project to Appwrite in one click

To get started, log into your Appwrite cloud, click the **Create project** button, input `supabase-migration` as the name, and then click **Create**.

![appwrite-project-tab](https://paper-attachments.dropboxusercontent.com/s_1B57EA89652AF2B21132DEEEF77C4F993DC010B6520EAE2EEC76AFD70BFFE211_1696596524201_image.png)


Next, navigate to the **Settings** and click on the **Migrations** tab.

![appwrite-migration-tab](https://paper-attachments.dropboxusercontent.com/s_1B57EA89652AF2B21132DEEEF77C4F993DC010B6520EAE2EEC76AFD70BFFE211_1696596836692_image.png)


Next, click the **Import data** button and select **Supabase** as your source.

![appwrite-migration-source](https://paper-attachments.dropboxusercontent.com/s_1B57EA89652AF2B21132DEEEF77C4F993DC010B6520EAE2EEC76AFD70BFFE211_1696030850160_image.png)


Then, you must fill in the details of your Supabase **Postgres credentials** in the appropriate fields and click **Next**.

![appwrite-migration-config](https://paper-attachments.dropboxusercontent.com/s_1B57EA89652AF2B21132DEEEF77C4F993DC010B6520EAE2EEC76AFD70BFFE211_1697190508041_image.png)

> **Note:** You can get the **Host**, **Port**, **Username**, and **Password** credentials from your Supabase **Settings** > **Database,** while you can get the **Endpoint** and **API Key** credentials at the Supabase **Settings** > **API**

Next, select the **Resources** you want to migrate; you can choose one or all available options. In this case, select the **Databases** and click on **Create** to start your migration.

![appwrite-migration-resources](https://paper-attachments.dropboxusercontent.com/s_1B57EA89652AF2B21132DEEEF77C4F993DC010B6520EAE2EEC76AFD70BFFE211_1696032497871_image.png)


While waiting for your data to import, navigate to your project **Overview** and **Add platform**. Choose **Web App** and complete the necessary fields. This is necessary because Appwrite will reject requests from any unknown web to protect them from malicious attacks.

![appwrite-project-overview](https://paper-attachments.dropboxusercontent.com/s_1B57EA89652AF2B21132DEEEF77C4F993DC010B6520EAE2EEC76AFD70BFFE211_1696597001037_image.png)


After completing the above configurations, navigate back to your Migration tab, and you should see this in your imported data.

![appwrite-migration-tab](https://paper-attachments.dropboxusercontent.com/s_1B57EA89652AF2B21132DEEEF77C4F993DC010B6520EAE2EEC76AFD70BFFE211_1696597116326_image.png)


The above indicates that your supabase project has successfully transferred to your Appwrite.

To confirm this, click on **Databases** and check your database collections. You should see something like this:

![updated-appwrite-database](https://paper-attachments.dropboxusercontent.com/s_1B57EA89652AF2B21132DEEEF77C4F993DC010B6520EAE2EEC76AFD70BFFE211_1696597183085_image.png)


You have successfully imported your Supabase project into your Appwrite without hassle.

## Conclusion
This post discussed how to quickly transfer your data from other sources like Supabase to [Appwrite Cloud](https://cloud.appwrite.io/?utm_source=hackmamba&utm_medium=hackmamba-blog). This process also demonstrates how Appwrite as a backend-as-a-service makes development less hassle for developers and businesses with the easy use of Appwrite Migration.

## Resource
- [Appwrite Cloud](https://cloud.appwrite.io/?utm_source=hackmamba&utm_medium=hackmamba-blog)
- [Appwrite Migration](https://appwrite.io/docs/advanced/migrations?utm_source=hackmamba&utm_medium=hackmamba-blog)
- [Appwrite Migration Supabase](https://appwrite.io/docs/advanced/migrations/supabase?utm_source=hackmamba&utm_medium=hackmamba-blog)
- [Appwrite Pink Design](https://pink.appwrite.io/?utm_source=hackmamba&utm_medium=hackmamba-blog)