Module empty database after restore of a course

Module empty database after restore of a course

by Eduardo Hm -
Number of replies: 5

Good Morning,


I was a problem when restoring the contents of a course, in which, among other activities, there are several modules referencing database. The problem is that the restore process ends properly, but when entering one of those modules database, appears completely empty. Why not restore data me during which I made the backup?


I'm working with Moodle 3.0.


As you can see from the two screenshots, one of the screenshots shows the contents of the database activity course that will perform the backup. The other screenshot belongs to the restoration of the previous course in which you can see that there is no data in the same database activity


Thank you very much in advance.

Attachment screenshot_315.jpg
Attachment screenshot_316.jpg
Average of ratings: -
In reply to Eduardo Hm

Re: Module empty database after restore of a course

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

If you want the database activity contents to be restored you would need to restore the course with user data too. Otherwise you can export the database entries and then import them into your new course - see here: Using Database the sections on exporting and importing entries.

In reply to Mary Cooch

Re: Module empty database after restore of a course

by Eduardo Hm -

Hello Mary,


Thank you very much for the prompt response that you gave me.


The backup of course I make full, marking the option to include the enroled users.


I have made export-import data module Moodle database and works correctly, but one of the activities database, records have attachments, and they can not be exported. Is there no fix for the export of these attachments records activity Moodle database?


Thanks again.

In reply to Eduardo Hm

Re: Module empty database after restore of a course

by William Lu -
Picture of Particularly helpful Moodlers

As Mary said: 

If you want the database activity contents to be restored you would need to restore the course with user data too.

The user role must have the permission which can backup/restore with User Date. By default, a teacher role will see this:


If you are the Site admin, you can backup/restore on behalf of a teacher.

If you don't want to involved to that kind of job, you can override the permission for that teacher or in a course level:


Moodle warns security risks! I think it is mainly about your users' profile privacy.


The export/import feature is for text only, because it only generates .csv file, neither image nor file can be included.


I don't think there will be a 'fix for the export of these attachments records activity Moodle database..', because there is workaround in backup/restore (as shown above) already.


HTH

In reply to William Lu

Re: Module empty database after restore of a course

by Eduardo Hm -

Thank you very much for the reply William Lu,


I have tried several things, but still does not export the data module moodle database:


1 - First, being a site administrator, I have done the backup of the course in which there are several modules Moodle database with records. I have checked all the boxes in the settings of the backup to export me the entire content, including user data. When restoring to a new empty course, I exported all course content except modules records database I have.


2- If you use the tool import / export module database, makes me properly export the content of the activity, but does not make me export the files that are attached to each of the records, and that's I precisely what matters most, to export the attachments to each record in the database module too.


Any explanation why is not successful? Can it be due to the version of Moodle? As discussed users of the platform that I manage, two years ago, when they made copies and restorations of course, the entire contents of the module database files with attachments also exported.


Anyway, thank you very much in advance.

In reply to Eduardo Hm

Re: Module empty database after restore of a course

by William Lu -
Picture of Particularly helpful Moodlers

1. Are you sure? 

When restoring to a new empty course, I exported all course content except modules records database I have.

I think it should be:  "When restoring to a new empty course, I exported restored all course content except includes modules records database I have."

2. As in my previous reply, the import/export is .csv file only, won't include files. This is a feature, not a bug. It doesn't include much user info, hence it is much safer, and smaller in file size, easy to be shared. If you want to include attachments, don't use this feature.

3. I don't think the version is matter, you can restore a database backup to a lower or higher version.

4. Have you checked the permission settings? Have you tried to restore/backup a forum with user data? Have you tried to backup/restore an entire course with user data? If you can't get any user data resorted, means your permission settings need to be reset.

5. I attached a Database backup which has file attachments. Please let me know if it works on your Moodle or not. If you see a version warning, just ignore it, I have tested it. It works in any version of Moodle. 


Good luck.