

- #CREATE TEMP TABLE IN A FOR LOOP IN PHP INSTALL#
- #CREATE TEMP TABLE IN A FOR LOOP IN PHP UPDATE#
- #CREATE TEMP TABLE IN A FOR LOOP IN PHP UPGRADE#
- #CREATE TEMP TABLE IN A FOR LOOP IN PHP FULL#
- #CREATE TEMP TABLE IN A FOR LOOP IN PHP DOWNLOAD#
In terminal/ssh session, login as root and go to the moodledata/temp/backup/ directory. In the Moodle UI get to the screen where you click the button to begin the process and pause. Sounds like you do have terminal/ssh access. I've had to do that with courses like 'Digital Photography' and "American Sign Language" (the second used video for everything! The best course I've ever seen when considering objectives of the course and appropriate use of technology! Students had a blast with it and learned along the way!!!).Īnd please let me know if you need that course I restored on the other box.
#CREATE TEMP TABLE IN A FOR LOOP IN PHP FULL#
Make them semester courses even though the real class is a full year. That's a base line course then one could work on in spare time to rid of Legacy, etc., etc.Īlso consider breaking up a full year course that you know by the end of the year reaches 'critical mass' when it comes to backups/restores. Backup the course again via command line.

basically roll it back to like it was before students were enrolled. Choose options to remove students and their assignments, quiz attempts, grades. Instead of backup and restore, do 'reset' of the current course. I'd do that via command line backup from the script in admin/cli/ and point the backup to go to a unirepo that dev can reach/see. could restore to dev using Moosh if need be. Maybe a slightly different flow is needed if there are other courses like this one.Īt end of this year, backup the course for archival purposes.

If your courses are in Legacy, they will forever be in legacy on backup and restore - unless one edited the moodle_backup.xml and files.xml in an un-archived backup, re-compressed (properly), then restore.

no issues with time outs uploading/downloading, no increase file size uploads, etc. I've done exactly as briefly described above for 3 sites (different entities) who 'share' courses amongst themselves - one unirepo - 3 production sites.
#CREATE TEMP TABLE IN A FOR LOOP IN PHP DOWNLOAD#
no download only to have to turn around and upload (the backup. Set up the file system repo in only one course that you won't be deleting in the dev instance, and you can backup/restore on that server in less time. Then, in the dev instance, set up a file system repo pointed to the unirepo. will be faster and can backup larger courses. Those backups, run from the command line, take apache out of the loop. which would save the backup to the unirepo. Setting up a unirepo would enable you to do command backup of a course in production server. the alias problem when restoring to other server). Since you have ssh access you might consider setting up a 'unirepo' (universalrepo) using file system (you're already using file system repo with your courses. I'm happy to send anyone a copy of the course to play with if you'd like. I've looked through the backup/restore log files and I've seen nothing interesting.
#CREATE TEMP TABLE IN A FOR LOOP IN PHP INSTALL#
I've tried to restore the backup on a clean Moodle install with no plugins and it also fails. I'm assuming this means the mySQL permissions are set correctly for the db user. I've restored several other courses on our site today with no issues what so ever. When I go to delete the failed course after the restore fails it shows many question categories being deleted but not all of them. It seems to fail in the middle of restoring the question bank. Must be dropped! This is the only message even with debugging turned up to Developer. I've been trying to restore a copy of my personal course to use with the next semester coming up and it fails regularly with the message: Potential coding error - existing temptables found when disposing database.
#CREATE TEMP TABLE IN A FOR LOOP IN PHP UPGRADE#
I was planning to upgrade after I did the course restores) For example, one could think that creating a temporary table one time and then loop on that table with cursors several times is an optimization – but that’s not the case.Running 2.9.3+ (yes I know. But one should certainly be aware of this behavior. I am not complaining, and I don’t even know if this behavior can be changed. MySQL > SHOW STATUS LIKE 'Created_tmp_tables'
#CREATE TEMP TABLE IN A FOR LOOP IN PHP UPDATE#
SELECT id FROM t WHERE 0 LIMIT 0 FOR UPDATE Id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY SELECT FROM a temporary table: you are reading from a temporary tables, yes, but an internal temporary table is created anyway.Ī quick example: CREATE TEMPORARY TABLE t.FOR UPDATE: An exclusive lock is created, yes, but you still read data from a temporary table. However, in some cases one does not expect a temporary table to be created: In MariaDB and MySQL, cursors create a temporary table.ĭoes this statement deserve a whole blog post? Apparently not.
