I'm backing up and restoring courses from moodle 3.0 to moodle. 3.4 both on ubuntu servers.
I've used Moosh on both and when I try to restore the course is always blank. I tried to restore to the same 3.0 Moodle server just as a test and it's blank there too. I'm using:
moosh -n course-backup -f /tmp/mybackup.mbz 77
checked the defaults for backup and selected variously but always include activities and questions and still it imports blank courses.
Checked importing defaults on moodle 3.4 and all are selected so I should not have an issue.
I read Ken's suggestion to use nohup here and wondered if this technique works with 3.0 and above? or if it would make a difference.
ex, nohup php ./backup.php --courseid=INTEGER --destination=STRING
I've read it can be many other issues at your link here but that list is so long I don't know where to begin.
I know you said there are not many flags and I saw the -e flag in backingup but I think that means to an EXISTING course not everything. It takes the defaults as I've read and I have played with defaults with no luck. Thanks for advice.
The nohup affects any shell command issued ... no hang up ... complete the script ... period. I use it only when the ssh server timeouts kick in before the backup/restore commands have a chance to complete.
The other thread you referenced dealt with an addon in a course and the poster did find a hack that fixed his issue .... relating to the addon/plugin.
The restore begins with the backup ... so do you have addons/plugins active in the course you are trying to backup? What if you created a backup, via the Moodle Admin UI, set backup preferences to a directory outside of Moodle filedir and excluded anything/everything that was non-core (ie, no addons/plugins)?
On the 3.0 server ... have you run the hidden/still experimental health check?
That does find issues with Quizzes and does offer SQL suggestions on how to fix. If you find any, run the SQL fix. Any of those Quizzes in the course you are trying to backup via moosh and restore to higher version server?
I would think that using command line moosh, if there were an error it would display or one could setup php to log errors. In one shell window, run the moosh command. In another shell window, run tail -f /var/log/php-error.log ... that shows the error log in realtime.
Afraid there is just not enough info (you don't know what you don't know to share) to know and share exactly what the problem might be.
Check PM in Moodle .... I might have an offer you probably shouldn't refuse but do realize the backup contains users that I would be privy to.
'spirit of sharing', Ken
for those following. If I do it manually it works perfectly. two things I noticed, I do have a 3rd party app called Blackboard Ultra that I unchecked before importing. I wonder if that file would make the restore fail on the new moodle? Of course it should not affect it on the old moodle since that app is installed but you never know.
The second thing I noticed was a warning, "Role in backup file cannot be mapped to any of the roles you are allowed to assign"
It was for student which I manually selected and I did notice this error through Moosh too but am not sure which activity has a role assigned to it or if that would prevent the entire restore from working. More info to follow . . .
That plugin ... Blackboard Ultra ... would need to be installed in the new server AND configured to restore a course that used that plugin. Could cause a hickup in restore.
As far as role mappings ... in the setup of Blackboard Ultra, is there a sudo user ... account ... role setup with whatever Blackboard server with which it interacts?
Dunno if I found the right plugin or not ... does say:
Configuring the plugin
Collaborate Ultra plugin takes SAS admin credentials.
You say that was a student account .... can you un-enroll that student account from the troubled course?
'spirit of sharing', Ken
for those following this, I found a Workaround:
if I import the problem course into a new course but just activities, questions , and poorly edited topics/dates by user (where too many pics are in date) it works to moosh backup on that new course. That's a bit of a pain to create a new course every time a backup fails but at least it works.
note: I tried moosh backup with and without the plugin Ultra and both worked so that was not the holdup nor the topics/dates but something else.
Jamie and I have been 'collaborating' (not the mod) ... he uploaded an .mbz to a server outside of Moodle using Webmin.
That allowed me to inspect what was actually in the backup by un-compressing it and inspecting what was there.
In the un-compressed backup no user backup uploaded, in activities directory
assign_1302 assign_8608 label_1295 lesson_14329 quiz_1298 quiz_1311 quiz_8607 resource_1293 resource_8603
assign_8589 assign_9184 label_9194 lesson_14330 quiz_1300 quiz_8587 quiz_8609 resource_1303 resource_9181
assign_8591 bigbluebuttonbn_8586 label_9216 lesson_14331 quiz_1304 quiz_8588 quiz_8610 resource_14328 url_1294
assign_8593 collaborate_2735 label_9217 page_8613 quiz_1305 quiz_8595 quiz_8614 resource_8581 url_9190
assign_8596 collaborate_9493 label_9221 quiz_1296 quiz_1306 quiz_8599 quiz_9182 resource_8583
assign_8601 forum_9220 lesson_14327 quiz_1297 quiz_1309 quiz_8604 quiz_9183 resource_8598
All those but 'bigbluebuttonbn_8586', 'collaborate_2735 and collaborate_9493 are stock moodle. The numbers are the ID numbers of the assignment/label/quiz, etc..
and in the moodle_backup.xml which is a roadmap to restore:
[root@sos sos]# fgrep 'collaborate' moodle_backup.xml
Can see a 'userinfo' thang ... which I have no idea what it does ... but could have been the source for the user roles conflict.
Course was also fairly 'heavy processing' in quiz:
-rw-r--r--. 1 root root 1234304 Jun 28 18:30 questions.xml
Sometimes courses like this might look small when viewing the size of the .mbz file (only 7723823) but they are heavy processing on restore ... 1.2 megs worth of question data (approx) in quizzes.
One could edit xml files, re-package the backup and then TIA.
All the above NOT the recommended way to fix but when all else has failed it is possible to recoup some of the course.
'spirit of sharing', Ken