Migrate
Migrate from Postgres to Lantern Cloud
This guide assumes that you are currently using Postgres without pgvector
. If you are using pgvector
, please reference this guide instead. A few options are available for migrating from Postgres to Lantern Cloud.
Steps (bash)
We'll use the pg_dump
and psql
utilities to migrate the data. These utilities are available on Linux, Mac, and Windows by downloading Postgres.
-
Create a Lantern Cloud database
Sign up for Lantern Cloud and create a database. Obtain a database URL. We'll call this
LANTERN_DATABASE_URL
. -
Backup the old database using
pg_dump
Use the
pg_dump
utility to create a database backup. We assume below that your old database URL is stored in the environment variableOLD_DATABASE_URL
.bashCopypg_dump $OLD_DATABASE_URL > backup.sql
-
(Optional) Stop the old database
You may want to disable the old database at this time, to prevent missing data.
-
Transfer the data to Lantern Cloud database using
psql
sqlCopypsql $LANTERN_DATABASE_URL < backup.sql
-
Use the new database
Update any applications, scripts, or services to point to the new database. You're done!
Steps (TablePlus)
TablePlus is a GUI for managing databases. It is available for Mac, Windows, and Linux.
-
Create a Lantern Cloud database
Sign up for Lantern Cloud and create a database.
-
Backup the old database
Add the old database to TablePlus. Export the database to a CSV, JSON or SQL file using steps defined here
-
(Optional) Stop the old database
You may want to disable the old database at this time, to prevent missing data.
-
Transfer the data to Lantern Cloud database
Add the Lantern Cloud database to TablePlus. Import the data using steps defined here
-
Use the new database
Update any applications, scripts, or services to point to the new database. You're done!