Abstract


  • A popular relational database
  • Grab a free postgres db with Neon DB!
  • Obtain the Postgres Version using SELECT version();

Resolving PostgreSQL pg_dump server version mismatch

The newer version of Postgres isn’t included in a lot of the Package Manager, you need to add the package repository in manually! You can find many online tutorials on this, here is one for APT package manager.

Postgres Migration


Connection String Format

postgres://[user]:[password]@[db_hostname]/[dbname]

  • Dump from one DB to another
# Export
pg_dump -O -Fc -v -d <source_database_connection_string> -f <dump_file_name>
 
# Import
pg_restore -v -d <destination_database_connection_string> <dump_file_name>
  • Export data out in sql format
pg_dump -O -v -d <source_database_connection_string> > export.sql
  • For more information, refer to this guide

Neon DB


Neon_DB CLi Setup

brew install neonctl
neonctl auth
neonctl projects list

Data migration to NeonDB

Refer to Postgres Migration, more details see Data Migration to Neon.