Skip to content
Platform

从 Amazon RDS 迁移到 Supabase

Migrate your Amazon RDS MySQL or MS SQL database to Supabase.

本指南旨在展示如何将你的 Amazon RDS 数据库从 Postgres、MySQL 或 MS SQL 迁移到 Supabase 的 Postgres 数据库。虽然 Amazon RDS 是 AWS 提供的受欢迎的托管数据库服务,但它可能并不适合所有使用场景。另一方面,Supabase 提供了一个优秀的免费开源选项,涵盖了开发产品所需的所有后台功能:Postgres 数据库、身份认证、即时 API、边缘函数、实时订阅和存储。

🌐 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 and open source option that encompasses all the necessary backend features to develop a product: a Postgres database, authentication, instant APIs, edge functions, real-time subscriptions, and storage.

Supabase的核心是Postgres,它支持行级别安全,并提供访问超过40个Postgres扩展的功能。通过从Amazon RDS迁移到Supabase,你可以充分利用Postgres的潜力,并获得完成项目所需的所有功能。

🌐 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.

获取你的 Amazon RDS 数据库凭证 #

🌐 Retrieve your Amazon RDS database credentials [#retrieve-rds-credentials]

  1. 登录你的 Amazon RDS 账户
  2. 选择你的 RDS 数据库所在的区域。
  3. 进入 数据库 标签。
  4. 选择你想迁移的数据库。
  5. 连接与安全标签中,记下端点和端口号。
  6. 配置选项卡中,记下数据库名称和用户名。
  7. 如果你没有密码,就创建一个新的并记下来。

Copying RDS credentials from AWS Management Console

获取你的 Supabase 主机 #

🌐 Retrieve your Supabase host [#retrieve-supabase-host]

  1. 如果你是 Supabase 新手,创建一个项目。记下你的密码,你稍后会需要它。如果忘记了,可以在这里重置
  2. 在你的项目仪表板上,点击 连接
  3. 在会话池下,点击连接字符串下的查看参数。记下你的主机($SUPABASE_HOST)。

Finding Supabase host address

迁移数据库 #

🌐 Migrate the database

迁移你的数据库最快的方法是在 Google Colab 上使用 Supabase 迁移工具。

🌐 The fastest way to migrate your database is with the Supabase migration tool on Google Colab.

或者,你可以使用 pgloader,这是一个灵活且强大的数据迁移工具,支持多种源数据库引擎,包括 MySQL 和 MS SQL,并将数据迁移到 Postgres 数据库。对于使用 Postgres 引擎的数据库,我们推荐使用 pg_dumppsql 命令行工具,这些工具都包含在完整的 Postgres 安装包中。

🌐 Alternatively, you can use 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 Postgres installation.

  1. 从下拉菜单中选择源数据库的数据库引擎
  2. 在 Colab 注意本中设置环境变量(HOSTUSERSOURCE_DBPASSWORDSUPABASE_URLSUPABASE_PASSWORD)。
  3. 按照顺序运行注意本中的前两个步骤。第一个步骤设置引擎并安装必要的文件。
  4. 运行第三步开始迁移。这将花几分钟时间。

企业 #

🌐 Enterprise

联系我们 如果你在迁移项目时需要更多帮助。