restoring course from backup opens wrong page

restoring course from backup opens wrong page

by Steffen Riek -
Number of replies: 6

Hi guys,

I migrated my moodle from a testserver to an actuall live server. While the migration seems to have worked, I am missing my courses and when trying to open a course I am being send to a page to create a forum. This to me seems to be a bug in my moodle installment.

Seeing as this can not go live I tried to restore the courses from a backup. While trying to restore the first course from a backup-file moodle is then opening the wrong page.
It should open something like this https://domain/backup/backupfilesedit.php but it opens something like this https://domain/moodle/backup/backupfilesedit.php

My browser then gives me this error:
/moodle/moodle/backup/backupfilesedit.php was not found on this server.

I backed up the course on my testserver where the /moodle would be correct, but even when changing this in my config it just adds another /moodle in the sites adress. I am using moodle 3.0.3 on live server and 2.9 on testserver. Although the error does not appear a second testserver which runs moodle 3.0.3.

Do you guys have an idea how this might be fixed?


Average of ratings: -
In reply to Steffen Riek

Re: restoring course from backup opens wrong page

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Are you backing up the courses as MBZ files?

This seems to me to be an installation configuration issue - given '/moodle' etc.  So does the wwwroot URL match the one set-up in the web server configuration?  On Apache this would be the httpd.conf file.  With MBZ files the url should not matter.  But if the page cannot find the php file then an installation issue.

In reply to Gareth J Barnard

Re: restoring course from backup opens wrong page

by Steffen Riek -

Hi Gareth,

yes I am backing up courses as MBZ files.

The wwwroot URL matches the URL set up in apache configuration.
It is configured so that I can open moodle under https://domain/index.php and not under https://domain/moodle/index.php.

Only restoring a course points to https://domain/moodle/backup/backupfilesedit.php and not to https://domain/backup/backupfilesedit.php.
Every other site works as intended (well the courses point to forums but I think that could be an error with the IDs inside the DB wich can be fixed by deleting and restoring the courses).

In reply to Steffen Riek

Re: restoring course from backup opens wrong page

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

It does sound like something went strange with the install.  A few things to try below but in the end I would suggest restoring a backup, redownloading the moodle code and trying again.

1.  Delete your cache folders in your moodledata folder (they will be recreated).

2.  Did you run replace.php on your database to update the urls?  (found at admin/tools/replace/index.php)

3.  Double check your config.php and your apache setup


In reply to Emma Richardson

Re: restoring course from backup opens wrong page

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

You may also want to try creating a backup on each of your sites (live and test) and restoring that backup to the same site - it shouldn't have any problems, but may help narrow down which site is causing the issue if there are any (e.g. if backups from your old site don't restore cleanly on the old site, you would know the backup process is at fault rather than the restoring on the new one)

In reply to Richard Oelmann

Re: restoring course from backup opens wrong page

by Steffen Riek -

Hi Richard,

so when I backup my testsite and my livesite I get the following results:
- restoring test to test has no problem and works like a charm
- restoring live to live has the same issues as described above
- restoring live to test results in the same issues
- restoring test to live is the issue I described above

Therefor I don't think the backup has any issuess.

Which leaves the restore and the live server.

Restoring to another server has the same issue.

In reply to Emma Richardson

Re: restoring course from backup opens wrong page

by Steffen Riek -

Okay,

thanks for the tips.

Deleting the chache folders in moodledata did mess up my css for the first loading afterwards but it did not do anything else.

Replacing the old URL with the new ones also did not help, but it is helpfull to know that this exists.

I checked my config again and I can't see anything wrong with it either.


So I reinstalled, and lone behold exactly nothing changed...

Is it possible that the URL to access the course restore function is hardcoded? I mean, I hope not, but maybe?

If you guys don't have any other idea I can always redo the courses manually by copying from one editor to the other...