You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Create a new [Supabase project](https://supabase.com/dashboard).
78
78
- Install [Docker Desktop](https://www.docker.com) for your platform.
79
79
- Set environment variables for the old project's database URL as `$OLD_DB_URL` and the new project's as `$NEW_DB_URL`.
@@ -96,6 +96,20 @@ In your new project:
96
96
1. Enable [Database Webhooks](https://supabase.com/dashboard/project/_/database/hooks) if you enabled them in your old project.
97
97
2. Enable any [extensions](https://supabase.com/dashboard/project/_/database/extensions) that were enabled in your old project.
98
98
99
+
If you use [column encryption](/docs/guides/database/column-encryption), first copy the root encryption key to your new project using your [Personal Access Token](https://supabase.com/dashboard/account/tokens).
Setting the `session_replication_role` to `replica` disables all triggers so that columns are not double encrypted.
127
+
128
+
Troubleshooting notes:
112
129
113
130
- If you have created any [custom roles](https://supabase.com/dashboard/project/_/database/roles) with `login` attribute, you have to manually set their passwords in the new project.
114
-
- If you receive any permission errors when running `supabase db dump --db-url "$OLD_DB_URL" -f schema.sql`, you may need to edit the `schema.sql` file and change any lines saying `OWNER TO "supabase_admin"` to `OWNER TO "postgres"`.
131
+
- If you run into any permission errors related to `supabase_admin` during restore, edit the `schema.sql` file and comment out any lines containing `ALTER ... OWNER TO "supabase_admin"`.
132
+
133
+
### Schema changes to `auth` and `storage`
134
+
135
+
If you have modified the `auth` and `storage` schemas in your old project, such as adding triggers or RLS policies, you have to restore them separately. The Supabase CLI can help you diff the changes to these schemas using the following commands.
136
+
137
+
```bash
138
+
supabase link --project-ref "$OLD_PROJECT_REF"
139
+
supabase db diff --linked --schema auth,storage > changes.sql
0 commit comments