Moodle Migration Error: Database connection failed - During Upgrade

Keywords: Moodle - AWS - Technical issue - Upgrade
bnsupport ID: 87da74a4-4150-1435-f781-badfcd83f158
Hello, and thanks in advance! I’m attempting to upgrade Moodle from ~3.6 to 3.9.2. I believe I’m near the end, and have ran into some issues with the database. I believe this is due to the different databases being used, the old being sqli and the new being mariadb, or perhaps something else within the config.php file. I have began looking at my apache logs (I’ve pasted the last few rows at the bottom) and various guides and other submitted questions which I will also link below. I have ran the support tool and am including the ID at the end.

Any questions, please let me know! Also, FYI, old stack is Approach B and new stack is Approach A.

User question I looked at

Bitnami Tool ID: 87da74a4-4150-1435-f781-badfcd83f158

Also I’d like to add that I am able to login via phpmyadmin.

I am able to access phpmyadmin using the root user. Must the credentials within the config.php file be of the user ‘bn_moodle’?

Hi @chrisj,

Just to confirm, you are following the migration guide to move your site from one instance to another one, right?

We will work on reproducing the issue and will update this ticket and the documentation if necessary.

Hi jota,

Yes, following exactly that documentation you linked. Please let me know if you need anything else from me.


Hi @chrisj,

I got an error with the configuration when following the migration steps. That was due to some differences in the config.php file (the dataroot folder is different in the new version and you need to keep that change). In order to solve the problem, I copied the config.php file before removing the moodle and moodledata folders in the step 3

sudo cp /bitnami/moodle/config.php ~/

You will later need to copy the config.php file back to the moodle folder and configure the permissions. After finishing with the process, the application showed the test course I created in the previous deployment

That worked! Thank you very much @jota .

So, appears that all course information is there, and I’ve verified the mdl_user table contains the previous users. But I’m not able to get logged in using any account. Any idea?

Forgive me for multiple posts, but after further research I am convinced it has to do with us using the Adaptable theme and something regarding the login token not being present on the theme? I have checked the theme versions, and it appears both are up to date at version 2.2.X. On the new instance, it appears the Adaptable theme is NOT being applied.

Hi @chrisj,

I followed the migration process again and everything went fine. I could also login to the application using the “old” user’s credentials and confirmed that the information is in the mdl_user table as well.

I suggest you take a look at the Apache’s log to see if there is any error there that helps you debug the issue.

If not, I’d contact the Moodle’s developers to know if there is any extra step you need to perform to complete the migration of your data.

Solved! I’m rather embarrassed to say that it appears a setting that allowed us to login via email was disabled, which is what I had been used to. So upon, using the username instead… I was able to get in. Thanks again for your speedy resolution.

I’m really happy to hear that!

Enjoy! :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Thanks for pointing this out. We have updated the guide to clarify this point: