Skip to content

Commit 91399f8

Browse files
committed
Add docs on migrating between instances.
1 parent 1ef02af commit 91399f8

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

mint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@
360360
"self-hosting/lifecycle-maintenance/securing-your-deployment",
361361
"self-hosting/lifecycle-maintenance/healthchecks",
362362
"self-hosting/lifecycle-maintenance/telemetry",
363+
"self-hosting/lifecycle-maintenance/migrating",
363364
"self-hosting/lifecycle-maintenance/multiple-instances"
364365
]
365366
},

self-hosting/lifecycle-maintenance.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ It is currently required to host the API container on a dedicated subdomain - we
7272

7373
For self-hosting, [nginx](https://nginx.org/en/) is always a good option. A basic nginx configuration could look like this:
7474

75-
```
75+
```yaml
7676
server {
7777
listen 443 ssl;
7878
server_name powersync.example.prg;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: "Migrating between instances"
3+
description: "Migrating users between PowerSync instances"
4+
---
5+
6+
## Overview
7+
8+
In some cases, you may want to migrate users between PowerSync instances. This may be between cloud and self-hosted instances, or even just to change the endpoint.
9+
10+
If the PowerSync instances use the same source database and have the same basic configuration and sync rules, you can migrate users by just changing the endpoint to the new instance.
11+
12+
To make this process easier, we recommend using an API to retrieve the PowerSync endpoint, intead of hardcoding the endpoint in the client application. If you're using custom authentication, this can be done in the same API call as getting the authentication token.
13+
14+
There should be no downtime for users when switching between endpoints. The client will have to re-sync all data, but this will all happen automatically, and the client will atomically switch between the two. The main effect visible to users will be a delay in syncing new data while the client is re-syncing. All data will remain available to read on the client for the entire process.

0 commit comments

Comments
 (0)