Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat: amazon-rds migration guide

Rodrigo Mansueli Nunes420d024520fa
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index 240e34fdf32..ace2c311ee3 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -804,6 +804,11 @@ export const resources = {
url: '/guides/resources/migrating-to-supabase/render',
items: [],
},
+ {
+ name: 'Amazon RDS',
+ url: '/guides/resources/migrating-to-supabase/amazon-rds',
+ items: [],
+ },
],
},
],
@@ -849,6 +854,7 @@ export const migrate = {
{ name: 'Firebase Storage', url: '/guides/migrations/firebase-storage', items: [] },
{ name: 'Heroku', url: '/guides/migrations/heroku', items: [] },
{ name: 'Render', url: '/guides/migrations/render', items: [] },
+ { name: 'Amazon RDS', url: '/guides/migrations/amazon-rds', items: [] },
],
}
diff --git a/apps/docs/pages/guides/resources.mdx b/apps/docs/pages/guides/resources.mdx
index c2f2e4aa2a3..5bda171db2f 100644
--- a/apps/docs/pages/guides/resources.mdx
+++ b/apps/docs/pages/guides/resources.mdx
@@ -141,6 +141,12 @@ export const migrationGuides = [
href: '/guides/resources/migrating-to-supabase/render',
description: 'Migrate your Render Postgres database to Supabase.',
},
+ {
+ title: 'Amazon RDS',
+ icon: '/docs/img/icons/aws-rds-icon',
+ href: '/guides/resources/migrating-to-supabase/amazon-rds',
+ description: 'Migrate your Amazon RDS database to Supabase.',
+ },
]
export const postgres = [
diff --git a/apps/docs/pages/guides/resources/migrating-to-supabase/amazon-rds.mdx b/apps/docs/pages/guides/resources/migrating-to-supabase/amazon-rds.mdx
new file mode 100644
index 00000000000..8ca5ae3dcbe
--- /dev/null
+++ b/apps/docs/pages/guides/resources/migrating-to-supabase/amazon-rds.mdx
@@ -0,0 +1,96 @@
+import Layout from '~/layouts/DefaultGuideLayout'
+
+export const meta = {
+ title: 'Migrate from Amazon RDS to Supabase',
+ description: 'Migrate your Amazon RDS MySQL or MS SQL database to Supabase Postgres database.',
+}
+
+Supabase, an open-source alternative to Amazon RDS, offers a potent and adaptable Postgres database with a plethora of features, such as row-level security and over 40 Postgres extensions. Besides, Supabase boasts various backend functionalities, including authentication, instant APIs, edge functions, real-time subscriptions, and storage.
+
+This guide aims to exhibit the process of transferring your Amazon RDS database from any of these engines Postgres, MySQL or MS SQL to Supabase's Postgres database. Although Amazon RDS is a favored managed database service provided by AWS, it may not suffice for all use cases. Supabase, on the other hand, provides an excellent free option that encompasses all the necessary backend features to develop a product, comprising a Postgres database, authentication, instant APIs, edge functions, real-time subscriptions, and storage.
+
+Supabase's core is Postgres, enabling the use of row-level security and providing access to over 40 Postgres extensions. By migrating from Amazon RDS to Supabase, you can leverage Postgres to its fullest potential and acquire all the features you need to complete your project.
+## Retrieve your Amazon RDS database credentials [#retrieve-rds-credentials]
+
+1. Log in to your [Amazon RDS account](https://aws.amazon.com/rds/).
+1. Select the region where your RDS database is located.
+1. Navigate to the **Databases** tab.
+1. Select the database that you want to migrate.
+1. In the **Connectivity & Security** tab, note down the Endpoint and the port number.
+1. In the **Configuration** tab, note down the Database name and the Username.
+1. If you do not have the password, create a new one and note it down.
+
+![Copying RDS credentials from AWS Management Console](/docs/img/guides/resources/migrating-to-supabase/amazon-rds/amazon-rds_credentials.png)
+
+## Retrieve your Supabase Host [#retrieve-supabase-host]
+
+1. If you're new to Supabase, [create a project](https://app.supabase.com).
+1. Go to the [Database settings](https://app.supabase.com/project/_/settings/database) for your project in the Supabase Dashboard.
+1. Under **Connection Info**, note your Host (`$SUPABASE_HOST`).
+1. Save your password or [reset it](https://app.supabase.com/project/_/settings/database) if you forgot it.
+
+![Finding Supabase host address](/docs/img/guides/resources/migrating-to-supabase/amazon-rds/supabase_dashboard.png)
+
+## Migrate the database
+
+The fastest way to migrate your database is with the Supabase migration tool on
+ [Google Colab](https://colab.research.google.com/github/mansueli/Supa-Migrate/blob/main/Amazon_RDS_to_Supabase.ipynb).
+
+Alternatively, you can use [pgloader](https://github.com/dimitri/pgloader), a flexible and powerful data migration tool that supports a wide range of source database engines, including MySQL and MS SQL, and migrates the data to a Postgres database. For databases using the Postgres engine, we recommend using the pg_dump and psql command line tools, which are included in a full PostgreSQL installation.
+
+<Tabs
+ scrollable
+ size="small"
+ type="underlined"
+ defaultActiveId="colab"
+>
+<TabPanel id="colab" label="Migrate using Colab">
+
+1. Select the Dabase Engine from the Source database in the dropdown
+1. Set the environment variables (`HOST`, `USER`, `SOURCE_DB`,`PASSWORD`, `SUPABASE_URL`, and `SUPABASE_PASSWORD`) in the Colab notebook.
+2. Run the first two steps in [the notebook](https://colab.research.google.com/github/mansueli/Supa-Migrate/blob/main/Amazon_RDS_to_Supabase.ipynb) in order. The first sets engine and installs the necessary files.
+3. Run the third step to start the migration. This will take a few minutes.
+
+</TabPanel>
+<TabPanel id="MySQL" label="Migrate from MySQL with pgloader">
+
+ Install pgloader.
+ Create a configuration file (e.g., config.load).
+
+```sql
+LOAD DATABASE
+ FROM mysql://USER:PASSWORD@HOST/SOURCE_DB
+ INTO postgres://postgres:[email protected]:6543/postgres
+ALTER SCHEMA 'public' OWNER TO 'postgres';
+set wal_buffers = '64MB', max_wal_senders = 0, statement_timeout = 0, work_mem to '2GB';
+````
+
+##Run the migration with pgloader
+
+```bash
+pgloader config.load
+```
+</TabPanel>
+<TabPanel id="MS SQL" label="Migrate from MSSQL">
+
+ Install pgloader.
+ Create a configuration file (e.g., config.load).
+
+```sql
+LOAD DATABASE
+ FROM mssql://USER:PASSWORD@HOST/SOURCE_DB
+ INTO postgres://postgres:[email protected]:6543/postgres
+ALTER SCHEMA 'public' OWNER TO 'postgres';
+set wal_buffers = '64MB', max_wal_senders = 0, statement_timeout = 0, work_mem to '2GB';
+````
+
+##Run the migration with pgloader
+
+```bash
+pgloader config.load
+```
+</TabPanel>
+</Tabs>
+
+export const Page = ({ children }) => <Layout meta={meta} children={children} />
+export default Page
diff --git a/apps/docs/public/img/guides/resources/migrating-to-supabase/amazon-rds/supabase_dashboard.png b/apps/docs/public/img/guides/resources/migrating-to-supabase/amazon-rds/supabase_dashboard.png
new file mode 100644
index 00000000000..3a1ff5b9daf
Binary files /dev/null and b/apps/docs/public/img/guides/resources/migrating-to-supabase/amazon-rds/supabase_dashboard.png differ