database migration
commonly-ts
PROOP

5 months ago

how do you go about migrating the data from a MySQL database to Postgres in the same project?

Solved$20 Bounty

Pinned Solution

5 months ago

Migrating from one DB to a different one is a bit complicated as it involves a lot of data types transformation and you will probably need an external software/script to do the conversion.

PostgreSQL wiki suggests using https://www.convert-in.com/mysql-to-postgres but it was last updated in 2023, I know about https://pgloader.io/ but I've never actually used it.

3 Replies

dardameiz
PRO

5 months ago

Hey, I am using DBeaver for my databases, dev: sqlite and preprod, prod, sandbox postgres. In DBeaver you can use SQL commands to migrate data or you can write a command file in your IDE (am using va code) that connects to those databases and do the data migrations.


5 months ago

Migrating from one DB to a different one is a bit complicated as it involves a lot of data types transformation and you will probably need an external software/script to do the conversion.

PostgreSQL wiki suggests using https://www.convert-in.com/mysql-to-postgres but it was last updated in 2023, I know about https://pgloader.io/ but I've never actually used it.


diogoribeirodev
FREE

5 months ago

Use pgloader as medim recommend, you can do it with a single command:

pgloader mysql://root@localhost/f1db pgsql:///f1db

you will probably need to define your casting rules ( convert mysql types to postgres types )

https://pgloader.io/about/ ( scroll down )


Status changed to Solved medim about 1 month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...