Django从MySQL迁移到Postgres

时间:2022-12-18 20:15:06

I recently decided that I want to switch from MySQL to Postgres because of a few problems I have been having which should never be a problem on Postgres.

我最近决定我要从MySQL切换到Postgres,因为我遇到了一些问题,这些问题永远不会成为Postgres的问题。

However I cannot seem to find a nice way to migrate I have taken a look at py-mysql2pgsql however this caused issues within the database which I cannot track down.

但是我似乎无法找到一个很好的迁移方式我已经看了py-mysql2pgsql然而这引起了数据库中的问题,我无法追踪。

I also looked into dumpdata and loaddata using django-admin.py however my database is rather large and it consumed all my memory and simply crashed so I then moved onto django-dumpdata-chunks which just errors out but then again the projec is two years old.

我也使用django-admin.py查看了dumpdata和loaddata,但是我的数据库相当大,它消耗了我所有的内存并且简单地崩溃了所以我转移到了django-dumpdata-chunks,这只是错误,但是再次projec是两年旧。

What I am asking is does anyone here know of a good reliable way to migrate from mysql to postgres without breaking the database and as a bonus if possible without downtime?

我要问的是,这里有没有人知道一个很好的可靠方法从mysql迁移到postgres而不破坏数据库,如果没有停机时可以作为奖励?

1 个解决方案

#1


3  

Check out pgloader. It should make your life a lot easier.

看看pgloader。它应该让你的生活更轻松。

#1


3  

Check out pgloader. It should make your life a lot easier.

看看pgloader。它应该让你的生活更轻松。