Migration from MySQL to PostgreSQL

Migration from MySQL to PostgreSQL

by Ali Karim -
Number of replies: 4

I'm using Moodle 3.6 and trying to migrate from MySQL db to Postgres. I do it via CLI, everything goes well without any issues, it creates all the tables, but doesn't transfer data. 

I did it a couple of times with Aurora/PostgreSQL and PostgreSQL, and got the same result. 

Any suggestions?


Thanks,

Ali 

Average of ratings: -
In reply to Ali Karim

Aw: Migration from MySQL to PostgreSQL

by Luca Bösch -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Some years ago, I used https://github.com/AnatolyUss/FromMySqlToPostgreSql to acheive such a thing.
I can't promise you it still works but it did the job nicely for me.
In reply to Luca Bösch

Re: Aw: Migration from MySQL to PostgreSQL

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
it is better to use the builtin moodle tool to do this - it's a bit slower, but it means that your db will be set up with the correct datatypes/default values etc. Using an external tool like the one linked above is more likely to result in a database that uses unexpected configuration.

go to admin/tool/dbtransfer - is that what you are using to do this?
Average of ratings: Useful (2)
In reply to Dan Marsden

Re: Re: Aw: Migration from MySQL to PostgreSQL

by Ali Karim -
Hi Dan,
Yes, I tired CLI and it creates empty tables without transferring data. I did it a couple of times but got the same result.