Moving Your Database Between Homes
Take everything (people, clients, findings, files and secrets) from PostgreSQL in your cloud, a self-hosted stack or Supabase Cloud to either of the others, in your own browser, with nothing passing through Pental.
Where your database lives is not a decision you are stuck with. The move copies everything from your current database to a new one in any of the three homes, compares the two table by table, and switches the portal over only when you say so. It runs in your own browser, or on your own computer, with your databases’ own credentials. Nothing passes through Pental.
Before you start
- The new database, set up as its guide describes: PostgreSQL in your cloud, self-hosted Supabase or Supabase Cloud. The move shows the same steps for it.
- Each database’s own service credential, which only the move uses (see the next section).
- A quiet moment: while the copy runs, reading and signing in carry on, but saving pauses.
Where each credential is
| Home | The credential, and where to find it |
|---|---|
| PostgreSQL in your cloud | The gateway’s setup token (pst_…), from your password manager or beside its deploy script, in the pental-gateway folder: grep ^SETUP_TOKEN= deploy/*/.deploy-*.env deploy/compose/.env on macOS or Linux, Get-ChildItem deploy -Recurse -Force -Filter .deploy-*.env | Select-String ^SETUP_TOKEN= in PowerShell. |
| Self-hosted Supabase | The stack’s service key. On its server, in the kit’s folder, grep ^SERVICE_ROLE_KEY= .env prints it. |
| Supabase Cloud | The project’s service_role key (it starts eyJ), under API Keys, then Legacy API keys. Supabase refuses its newer sb_secret_ keys from a browser, so a project with only those moves from your computer instead. |
They go from your browser to your own databases and nowhere else, are never sent to Pental, and are dropped when the move ends.
Start the move
- On your pental.io dashboard, under Portal Configuration, open Database, and under Move your database press Start a move.
- Choose the new home and follow its steps, as at setup. The last one takes its credential: for a Supabase project, its legacy service_role key; for a stack, its service key; for a gateway, its setup token, and Prepare the new gateway applies the setup SQL through it.
- Press Next: your current database and paste the current one’s credential.
- Press Start the move, and keep the tab open while it runs.
What happens when you press it
- Both databases are checked: reachable, on the same setup SQL, and the new one empty (or you are asked before it is replaced).
- Saving pauses on the current database. People can keep reading the portal and signing in; anyone saving is told the database is being moved. Saving resumes by itself if the move stops.
- Every row, file and sealed secret is copied straight from one database to the other, through your browser.
- The two are compared, table by table. A file uploaded meanwhile is caught here, and you are asked to run it again.
- You decide: switch the portal to the new database (the old one is then closed, and everyone signs in again on the new one), or cancel and carry on as before.
Stop the move, or cancel at the end, and saving resumes on the current database with everything as it was. The portal switches only when every count matches, unless you choose otherwise.
From your own computer
For a Supabase project whose newer secret key a browser may not use, or a database too large to leave to a browser tab, the same move runs on your own machine, Windows, macOS or Linux. Under Or move from your computer the dashboard writes one paste for your computer, with both addresses in: it downloads pental-move.mjs and runs it with Node.js 18 or later, your computer’s own or, if you say yes, a copy it downloads from nodejs.org for the move alone. The mover asks for both credentials there, without showing them.
cd ~; curl.exe -fsSLO --retry 3 --retry-all-errors https://pental.io/downloads/pental-move.ps1; if ($?) { powershell -ExecutionPolicy Bypass -File pental-move.ps1 --from https://current-database --to https://new-database }cd ~
curl -fsSL https://pental.io/downloads/pental-move.sh | sh -s -- --from https://current-database --to https://new-databaseWhen it says every count matches, it keeps saving paused and waits. Switch the portal on your dashboard, then type SWITCHED in the terminal to close the old database for good.
Afterwards
The portal now runs on the new database, and everyone signs in again there. The old database refuses changes and tells anyone still on it to reload. Look around, then delete it, or its project, whenever you are ready.
Change Your Mind Whenever You Like
Every portal runs end-to-end encrypted on a database you own, in whichever of the three homes suits you, and moves between them from your dashboard.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, on your own server.
Also Worth Reading
Creating Your Database: Three Ways to Run It
Your portal runs end-to-end encrypted on a database you own, in one of three places: PostgreSQL in your own cloud, self-hosted Supabase, or Supabase Cloud. What each is, its pros and cons, and the full guide for each.
DatabaseSetting Up Your Database on PostgreSQL in Your Cloud
Your cloud’s own PostgreSQL on Azure, AWS or Google Cloud, or a server of yours, with the small Pental gateway beside it. One command builds it all, and it applies Pental’s signed updates itself.
DatabaseSetting Up Your Database on Self-Hosted Supabase
Supabase’s open-source stack on a server you run, from a kit we give you. One paste on the server puts in Docker if it is missing, makes the stack’s secrets and starts it, and it sets up and updates its own database.