Search code examples
mysqlpostgresqlmariadbdatabase-migrationmoodle

How to install or transfer the existing moodle project from ubuntu to Windows (Postgres to MariaDB sql)


My company has two web based project. Our main project (Starbooks) was built using xampp server and Codeigniter framework that installed in our Windows OS and the second project (Frontlearners) was built in Lamp server and moodle (LMS) framework with Postgres database that installed in ubuntu platform.

My goal is to collide this two projects into one by moving the second project (Frontlearners) into the main project (Starbooks) server which uses with xampp server windows platform.

My first attempt is to export the moodle Postgres database using PGAdmin then move the moodle project to the main project server on windows. But I don't know if this is the correct way or not because Postgres and mysql are different database type. I've searching across the internet hoping for the answer or tutorial related to my problem but the results are always fresh installation of moodle which is not related to my problem.

Anybody knows how to solve this problem, a tutorial link, or any article about this situation?


Solution

  • There is a database transfer tool in Moodle.

    https://docs.moodle.org/311/en/Database_transfer

    So you can convert the PostgreSQL database to MariaDB

    First ensure MariaDB is installed on Ubuntu

    Turn off cron and put the site in maintenance mode

    Then go to Site administration > Development > Experimental > Database migration to convert the database.

    Or direct to /admin/tool/dbtransfer/index.php

    The tool will check the database structure matches the structures in the install.xml files. If there are any differences, then you will need to update the relevant install.xml file or database table before continuing.

    If its a large database, then the UI will probably time out. So use the command line version instead:

    php admin/tool/dbtransfer/cli/migrate.php --help
    

    Having said all that, IMHO I would transfer the Windows project to Linux.