恢复到新项目
How to clone your existing Supabase project
测试版
你可以通过将已有项目的数据恢复到一个全新的项目中来克隆你的 Supabase 项目。这个过程只会创建一个仅含数据库的副本,需要手动重新配置才能完全复制你的原始项目。
🌐 You can clone your Supabase project by restoring your data from an existing project into a completely new one. This process creates a database-only copy and requires manual reconfiguration to fully replicate your original project.
将会转移什么?
- 数据库架构(表、视图、存储过程)
- 所有数据和索引
- 数据库角色、权限和用户
- 认证用户数据(来自认证模式的用户账户、哈希密码和认证记录)
- 加密根密钥(这样 Vault 的机密和加密列在新项目中仍然可读)
什么需要手动重新配置?
- 存储对象和设置(你的 S3/存储文件和桶配置不会被复制)
- 边缘函数
- 认证设置与 API 密钥
- 实时设置
- 数据库扩展和设置
- 阅读副本
无论你是使用物理备份还是时间点恢复(PITR),这个功能都可以让你轻松复制项目数据、安全地进行测试,或者恢复数据进行分析。这个功能仅限付费用户使用,并且需要源项目开启物理备份。
🌐 Whether you're using physical backups or Point-in-Time recovery (PITR), this feature allows you to duplicate project data with ease, perform testing safely, or recover data for analysis. Access to this feature is exclusive to users on paid plans and requires that physical backups are enabled for the source project.
PITR 是一个额外的附加功能,适用于启用了物理备份并且使用付费计划的组织。
🌐 PITR is an additional add-on available for organizations on a paid plan with physical backups enabled.
首先,切换到源项目——包含你想要恢复的数据的项目——然后进入数据库备份页面。选择恢复到新项目选项卡。
🌐 To begin, switch to the source project—the project containing the data you wish to restore—and go to the database backups page. Select the Restore to a New Project tab.
会显示可用备份的列表。选择你想使用的备份,然后点击“恢复”按钮。对于启用了 PITR 的项目,使用日期和时间选择器来指定你希望从哪个具体时间点恢复数据。
🌐 A list of available backups is displayed. Select the backup you want to use and click the "Restore" button. For projects with PITR enabled, use the date and time selector to specify the exact point in time from which you wish to restore data.
一旦你做出选择,Supabase 会处理剩下的所有事情。一个新项目会自动创建,复制原项目的关键配置,包括计算实例大小、磁盘属性、SSL 强制设置和网络限制。数据会保留在与源项目相同的区域,以确保符合数据驻留要求。整个过程完全自动化。
🌐 Once you’ve made your choice, Supabase takes care of the rest. A new project is automatically created, replicating key configurations from the original, including the compute instance size, disk attributes, SSL enforcement settings, and network restrictions. The data will remain in the same region as the source project to ensure compliance with data residency requirements. The entire process is fully automated.
完成恢复所需的时间很大程度上取决于涉及的数据量。如果你有大量数据,可以在开始克隆操作之前选择源项目上性能更高的磁盘配置。这些磁盘配置会被复制到新项目中。不过,这会产生额外费用,系统会在开始前显示出来。
🌐 The time required to complete the restoration can vary depending largely on the volume of data involved. If you have a large amount of data you can opt for higher performing disk attributes on the source project before starting a clone operation. These disk attributes will be replicated to the new project. This incurs additional costs which will be displayed before starting.
在使用“恢复到新项目”这个过程时,有几个需要注意的重要限制:
🌐 There are a few important restrictions to be aware of with the "Restore to a New Project" process:
- 通过恢复过程创建的项目目前不能作为进一步克隆的来源。
- 这个功能只有开启了物理备份的付费用户才能使用,确保恢复过程所需的资源和基础设施都到位。
在开始恢复之前,你会看到一个关于创建新项目所需费用的概览。新项目会根据源项目中的镜像资源产生额外的月度开销。在继续之前,仔细查看这些费用很重要。
🌐 Before starting the restoration, you’ll be presented with an overview of the costs associated with creating the new project. The new project will incur additional monthly expenses based on the mirrored resources from the source project. It’s important to review these costs carefully before proceeding.
一旦恢复完成,新的项目将在你的仪表板上可用,并将包含所选备份来源的所有数据、表格、架构以及已选择的设置。建议仔细查看新项目,并进行必要的测试,以确保一切都按预期恢复了。
🌐 Once the restoration is complete, the new project will be available in your dashboard and will include all data, tables, schemas, and selected settings from the chosen backup source. It is recommended to thoroughly review the new project and perform any necessary tests to ensure everything has been restored as expected.
新项目完全独立于它们的来源,因此可以根据需要进行修改和使用。
🌐 New projects are completely independent of their source, and as such can be modified and used as desired.
因为整个数据库都会被复制到新项目,所以这也会包括在源项目中启用的所有扩展。如果源项目中包含一些配置为执行外部操作的扩展——比如 pg_net、pg_cron、wrappers——复制完成后应该把它们禁用,以避免发生任何不想要的操作。
🌐 As the entire database is copied to the new project, this will include all extensions that were enabled at the source. If the source project included extensions that are configured to carry out external operations—for example pg_net, pg_cron, wrappers—these should be disabled once the copy process has completed to avoid any unwanted actions from taking place.
恢复到新项目是更有效管理环境的一个绝佳方式。你可以使用这个功能来创建测试环境进行试验、在不影响生产数据的情况下尝试更改,或者在遇到意外数据丢失时迅速恢复。
🌐 Restoring to a new project is an excellent way to manage environments more effectively. You can use this feature to create staging environments for testing, experiment with changes without risk to production data, or swiftly recover from unexpected data loss scenarios.