Data cache problem while table importing in new Moodle

Data cache problem while table importing in new Moodle

- Luka Tarkhnishvili の投稿
返信数: 8

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


Luka Tarkhnishvili への返信

Re: Data cache problem while table importing in new Moodle

- Ken Task の投稿
画像 Particularly helpful Moodlers

Not sure about your strategy nor goal (migrating a site?), but ... since you suspect database cache:

https://dev.mysql.com/doc/refman/5.7/en/query-cache-status-and-maintenance.html

Assuming DB is MySQL, in above link noted this:

"The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0."

So in moving forward with moodle, when mysql 8 is fully supported, your method of I guess migrating a site might hit bigger bumps!

'SoS', Ken


Ken Task への返信

Re: Data cache problem while table importing in new Moodle

- Luka Tarkhnishvili の投稿
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..
Luka Tarkhnishvili への返信

Re: Data cache problem while table importing in new Moodle

- Visvanath Ratnaweera の投稿
画像 Particularly helpful Moodlers 画像 Translators
> I just want courses, questions, answers, users, and roles

Sounds like https://docs.moodle.org/33/en/Course_backup followed by https://docs.moodle.org/400/en/Course_restore in to a fresh (and complete) V 4.0. You have to repeat those steps per course. If there are hundreds, there are ways of scripting the process.
Visvanath Ratnaweera への返信

Re: Data cache problem while table importing in new Moodle

- Luka Tarkhnishvili の投稿
Thanks, for your replay

This method, restore all courses and users or separate by categories?
There are many courses, how to scripting the process?


Luka Tarkhnishvili への返信

Re: Data cache problem while table importing in new Moodle

- Howard Miller の投稿
画像 Core developers 画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Peer reviewers 画像 Plugin developers
That sounds like a properly bad idea. There are all sorts of interdendencies in the database tables. Something is going to trip you up.
Howard Miller への返信

Re: Data cache problem while table importing in new Moodle

- Luka Tarkhnishvili の投稿
So how I can properly export/import, courses, questions, answers, users, and their roles from the old Moodle?
Luka Tarkhnishvili への返信

Re: Data cache problem while table importing in new Moodle

- Howard Miller の投稿
画像 Core developers 画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Peer reviewers 画像 Plugin developers
By using the built in backup and restore functionality.

It's not clear to me why you didn't just upgrade the old site. Are you effectively merging two sites?

If you have loads of courses, you can probably script something using https://moosh-online.com/
Luka Tarkhnishvili への返信

Re: Data cache problem while table importing in new Moodle

- Ken Task の投稿
画像 Particularly helpful Moodlers

Mr. V did provide 2 links where one could discover how to.

But ... basics below ...

Site course backup defaults is set to include users and data - everything is in a course backup for the course.

Your Windows 3.3 does have admin/cli/backup.php which could be looped through a text file of course ids that belong to a category.   Example site has a social studies (ss) category ID 3.  Query of DB that dumps only the course ID numbers from category ID for ss to a text file.   That text file is used in a looping batch file to run admin/cli/backup.php with parameters to save backups to a destination directory for all ss courses (course ids may not be sequential)

On the new server, all those ss course backups are uploaded to a similar directory structure and temp in admin/cli/ of that servers code (shorter command line and moosh commands must be called from within code directory).

On new server.   Create a category for ss.  Know it's course ID number..

moosh is installed on new server.  From that ss directory that contains all the ss course backups use the moosh command to restore each course backup contained therein to the ss category of the site.

For each category on old site, wash, rinse, repeat.

Potential catch 22's ...

admin user on old site was enrolled in a course.

addon plugins used in the 3.3 doesn't exist in the 4 or the plugin doesn't have a 4 version.

Themes are plugins ... set 4 site to force the use of boost.   After you get a catetory of courses restored, might query the DB for courses in that category to see what theme each course is expecting ... then correct if any are trying to use a theme not installed.

Once did a site like above ... 4000+ courses ... took hours without a break as 'customer' needed it yesterday!   Doable but you'll be brain dead when finished! 笑顔

'SoS', Ken