HACKER Q&A
📣 fosron

Zero-downtime migration from MongoBD to PostgresSQL


Hey,

we are looking for an efficient way to migrate away from MongoDB to Postgres. Were hosted on Mongo Cloud ATM but i dont think theyll provide us a solution.

Key thing is were running a system which can not go down, and looking online i could not find anything that seems reliable and would help us to achieve that. Developing an in house solution for a one-off job also seems to be not the best one.

Maybe someone has experience regarding that, and could at least point in a good way? Would be really helpful. Thanks!


  👤 gtirloni Accepted Answer ✓
I'm afraid there is no quick solution. Your app will have to write to both temporarily and make the switch, no way around adding logic to it.

Even if a multi-DB polyglot proxy/gateway exists, you'd still have to specify the relations, constraints, etc... at which point you'd better do that in your app to avoid lock-in.

Google for "mongodb to postgres downtime". I've found a few detailed articles.


👤 surprisetalk
I can think of a few different solutions for you, depending on your write/read loads and DB size. Unfortunately, I don't think any of your solutions will be quick/easy.

Feel free to schedule a call with me! I've done 3 large NoSQL to PG migrations for different orgs.

[1] https://calendly.com/taylor-town/30min