Environment
Moodle version 4.0.5+ (Build: 20221201)
PHP version 7.4.3
20.04.2-Ubuntu
Summary
I'm getting Error code: error_opening_file whenever I attempt to copy a course (see logs below). I've gotten this error code many times, and it just clicked what it might be, but I could still really use assistance!
Reference
I attempt to copy a course, for example, from the Site administration course management page, as shown below:

Clicking on the Copy course button gives me the actual error, with what appears to be an infinite loading circle on (in this example) the Copy course: IRB - GL - F22 notification in the background (no text ever populates there; it just shows the spinning loading icon). Here's an image for reference:

Error
With developer debugging turned on, I get the following errors logged (this chunk actually prints twice in a row, but I only put it once here to make it easier to look at):
Error code: error_opening_file
$a contents: /home/mycompany/moodledata/temp/backup//2f35c761dda08de9e55ed06c9ec86d64.log
* line 71 of /backup/util/loggers/file_logger.class.php: base_logger_exception thrown
* line ? of unknownfile: call to file_logger->__wakeup()
* line 97 of /backup/util/dbops/restore_controller_dbops.class.php: call to unserialize()
* line 499 of /backup/controller/restore_controller.class.php: call to restore_controller_dbops::load_controller()
* line 244 of /backup/util/helper/copy_helper.class.php: call to restore_controller::load_controller()
* line ? of unknownfile: call to copy_helper::{closure}()
* line 247 of /backup/util/helper/copy_helper.class.php: call to array_map()
* line 143 of /backup/util/helper/copy_helper.class.php: call to copy_helper::map_backupids_to_restore_controller()
* line 75 of /backup/util/ui/classes/output/copy_form.php: call to copy_helper::get_copies()
Analysis
So, I've just now noticed that I don't have a /home/mycompany directory on my current server anymore. I used to be on a shared server with cPanel, and that was the correct directory, but I migrated my Moodle over to AWS using an EC2 instance in a VPC some years ago, and the mycompany directory is now in the standard web directory: /var/www/html/mycompany. The moodledata directory is now on its own hard disk but on the same server, so that's at /moodledata on the webserver.
When I migrated, I used a fresh install of Moodle on the new server, but I copied the existing moodledata folder (and the existing MariaDBdatabase), while deleting its temp, cache, and other i-thought-were-ok-to-delete directories.
Questions
- Why is Moodle still attempting to open one of the old log files? Is this something I can correct? or is it an issue in Moodle core?
- Is this an issue with data that was generated and inserted into Moodle's database (MariaDB) when I first installed Moodle on the original machine?
- Why are there 2 slashes after the /home/mycompany/moodledata/temp/backup// directory? Is that a problem?
I appreciate any help!