Moodle Database Migration tool

Moodle Database Migration tool

by Moses M. Mwebaze -
Number of replies: 5

I am transferring a database but the migration tool  is reporting error at all times 

Can not connect target database, sorry.
Permission denied

Anyone with a solution?
Average of ratings: -
In reply to Moses M. Mwebaze

Re: Moodle Database Migration tool

by Ken Task -
Picture of Particularly helpful Moodlers

MySQL?

Please see:

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

I have used once ... DB server to which you are migrating has to have DB port (3306) opened in server firewall *and* in the config of the DB server to which you are migrating must allow the IP address of the sending server grants/permissions to create a new DB.

So ... on server from which you are migrating, suggest doing an nmap scan

nmap -P0 -p 3306 IPaddressofserver/to/which/you/are/xfering

IF response is closed ... must open that port on the destination server's firewall (operating system firewall).

Plus ... the destination DB server must allow the user being used to connect to it, permissions to create a new DB as well as xfer the data to it.

So from current server, a quick test:

mysql -h IPaddressofdetinationserver -u root -p

You will be prompted for it's root password.

If you give that correctly, your mysql prompt will appear.

Test by creating a database:

mysql> create database testing;

If that fails, destination DB server needs to be config'd so user being used can create and xfer data.

Note: you might be better off just doing an SQL dump from current.  XFer the sql dump file to new server, then import.

You might specific MySQL DB info ... per version ... at dev.mysql.com (assuming MySQL DB servers are involved).

https://dev.mysql.com/doc/refman/5.7/en/

If 5.6 change version number above ... ditto if version 8!

'SoS', Ken

In reply to Ken Task

Re: Moodle Database Migration tool

by Moses M. Mwebaze -

Thank Ken. I am going to work on this following your criteria and advice. 

In reply to Ken Task

Re: Moodle Database Migration tool

by Gilbert Loyogoy -
Hi ken I also tried the database migration. I am migrating into remote database but I always encounter some error maybe because i am migrating from mariadb to mysql
In reply to Gilbert Loyogoy

Re: Moodle Database Migration tool

by Ken Task -
Picture of Particularly helpful Moodlers
MariaDB is supposed to be a drop in replacement for MySQL. However, would think it must be configured like the MySQL server you are migrating from ... barracuda, utf8mb4 character set, uff8mb4_general_ci collations etc.
"SoS', Ken
In reply to Ken Task

Re: Moodle Database Migration tool

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
My VPS is using MariaDB, and my MAMP is using mySQL. I regularly replace my MAMP database (and moodledata) with my server's backup, and I have never noticed any problem.

PHP 7.2.30, MariaDB 10.2.31 on my VPS, PHP Version 7.2.8 & MySQL 5.7.23 on my MAMP.

When I do move the database from VPS to MAMP, I always drop the mySQL tables first. Not sure if this makes any difference.