Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

ANSWERED: Copy course gives me error code: error_opening_file

$
0
0
by Juno Sprite.  

I finally fixed the issue I originally posted here: Copy course gives me error code: error_opening_file

and super OG posted—what I now believe to be the birth of this issue—here: Course copying in progress - STUCK

I really wanted to document it, so that others don't have to go through years of distress, lol.

TL;DR: My moodle installation was on a shared server years ago, so the $dataroot folder, a.k.a. 'moodledata', was located at something like:
/home/companyname/moodledata.

After a couple of years on that shared server (using cPanel, ew!), I migrated over to a dedicated server. I moved my moodledata folder over to a new location and renamed it (by the way, you're not supposed to rename your $dataroot folder, because that can cause these very issues! I'm a rebel, though). I renamed it to something like this:
/var/www/sitedata

After A TON of research, I ran this SQL query from within MariaDB:
MariaDB [mysite_db]> SELECT id, operation, type, itemid, format, interactive, purpose, userid, status, execution, timecreated, timemodified FROM mdl_backup_controllers WHERE status = 200;

The key words here are in the condition, WHERE status = 200. A status of 200 means that the operation is awaiting execution (I think). The above query output this:
+-----+-----------+------+--------+---------+-------------+---------+--------+--------+-----------+-------------+--------------+
| id  | operation | type | itemid | format  | interactive | purpose | userid | status | execution | timecreated | timemodified |
+-----+-----------+------+--------+---------+-------------+---------+--------+--------+-----------+-------------+--------------+
| 121 | restore   |      |     28 | unknown |           0 |      80 |      2 |    200 |         2 |  1595612087 |            0 |
| 124 | restore   |      |     29 | unknown |           0 |      80 |      2 |    200 |         2 |  1596642669 |            0 |
+-----+-----------+------+--------+---------+-------------+---------+--------+--------+-----------+-------------+--------------+
2 rows in set (0.020 sec)

 As you can see above, I found out that I had 2 backups awaiting execution, which is perfectly normal, except they had been waiting for years. I know this because of the unix timestamp, timecreated, which is GMT: Friday, July 24, 2020 5:34:47 PM, so basically 4 years ago. I mean wow. The other key thing I noticed is that format is unknown for both entries. My heart was beating fast at this point. You'll never guess what I did next.

!!!!! DANGEROUS SQL COMMAND WARNING !!!!!

I deleted those entries from my MariaDB database:
MariaDB [mysite_db]> DELETE FROM mdl_backup_controllers WHERE status = 200;

The output was this (thank goodness):
Query OK, 2 rows affected (0.131 sec)


I then purged all caches from my Moodle server using the command line:
php /path/to/moodle/admin/cli/purge_caches.php

and ran the backup cleanup task as well:
php /path/to/moodle/admin/cli/scheduled_task.php --execute=\\core\\task\\backup_cleanup_task

The problem is gone, and I'm hyped about it. Thank you for reading.


Viewing all articles
Browse latest Browse all 6815

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>