0

I installed a new Moodle on a new Ubuntu server, then I export only a few tables, courses, questions, answers, users and their roles from the old Moodle database.

I adapted the database to the new version and imported it into the new Moodle, after which I cleared the cache with the purge all button, however, the imported data is not fully displayed in the Moodle interface, some of it is displayed and some of it is not.

I think the problem is in database caching but can't resolve this issue, please help me to solve this problem

more info:

The old version is 3.3 xampp mariaDB I'm moving to 4.0 ubuntu mysql

I don't want to transfer the whole data, I just want courses, questions, answers, users, and roles

After importing these tables in the new moodle with my method, for example, one of the two courses included in the category may appear, but not the other one, and if I manually add another course to this category, then the second course that was not visible will also appear.

can't find the reason of this..

Zeroone
  • 49
  • 12

1 Answers1

1

I wouldn't recommend upgrading this way, you will miss a lot of things in the database. Did you also copy the site data folder too? That folder will have physical files for the courses and users.

If you don't want to keep all data, then I would recommend upgrading to 4 first then remove the data you don't want. Delete from the front end though, not the database, otherwise you will have a lot of orphaned data.

First though you will need to upgrade from 3.3 to 3.6

https://docs.moodle.org/400/en/Upgrading#Check_the_requirements

3.6 is the minimum requirement for Moodle 4.0

Then upgrade from 3.6 to 4.0

If you don't want to do that, then you could use course backup on the old site and course import on the new site

If you have a lot of courses, then use the command line eg:

php admin/cli/backup.php --courseid=2 --destination=/moodle/backup/

https://docs.moodle.org/400/en/Course_backup#Backup_via_CLI_for_administrators

And for course restore eg:

php admin/cli/restore_backup.php --file=/path/to/backup/file.mbz --categoryid=1

https://docs.moodle.org/400/en/Course_restore#Restore_via_CLI_for_administrators

You can also export and import questions, roles and users but they will have a different id so won't matchup

If you are migrating to a new site, then you will need to copy the database and the sitedata

https://docs.moodle.org/400/en/Moodle_migration

Russell England
  • 9,436
  • 1
  • 27
  • 41