Identical Repls, migrate DB from one to another

I’ve had an issue with connecting to GIT in one of my repls, so the Replit engineering team helped me create a new repl and there I can manage my versions. However, I have a very nice postgre db in the original repl, which doesn’t exist in the new repl.

I’m trying to understand if I can migrate the db from the original repl to the new one.

help!

This is possible but requires several careful steps. Here’s what I’d recommend:

  1. Find the database connection details in your original repl’s Secrets tab
  2. Install PostgreSQL 17.2 on your local machine (on Mac: brew install postgresql@17)
  3. Use pg_dump to create a backup of your database locally (using the connection details from step 1)
  4. Create an empty database in your new repl
  5. Get the database connection information from your new repl’s Secrets tab
  6. Use the local psql command to restore the database to your new repl
3 Likes