Moodle clean update

Moodle clean update

by Carlos Sanchez -
Number of replies: 5

I want to do a clean update of moodle. I am going to go from a 3.1 version to a 3.9 version and my intention is the following:

  1. In a temporary server I install a 3.9 version and configure moodle and the theme.
  2. I export the students from the server with 3.1 version and import them on the server with 3.9 version.
  3. I do the same with the courses.
  4. I shutdown the server with 3.1 version  and modify the URL of the server 3.9 so that it replaces the one that the server had with 3.1 version.

The problem appears when using alias/shortcuts in files. I have defined a repositories instances of the site. This repository is cloned on the new server (files included) but when restoring the courses on the new server I lose the links to the files.

Is there any solution to solve this problem? Indicates that links are lost due to server change.

In the case of restoring the courses, on the new server, after modifying the URL to the final URL,wWill the failure also happen?

Sorry for the bad English.

Average of ratings: -
In reply to Carlos Sanchez

Re: Moodle clean update

by Ken Task -
Picture of Particularly helpful Moodlers

What you doing is called a "migration" ... move moodle to another server ... and am guessing to avoid having to go through 'painful' steps of upgrading, you've chosen new version of moodle on new server, then restore courses, etc.   How many courses?   Then change config file URL to old URL to server - thus keeping the same fully qualifed domain name (FQDN).

And, it appears you've tinkered with restore of a course that had links to files that now don't work ... even though you have manually re-created the symlinks in file system repository.

And, I am assuming linux ... right?

A couple of catch 22's (issues):

Does your new server (assuming apache) have followsymlinks setup correctly?   Compare apache config of old server with new server.

Moodle uses the wwwurl config line to populate internal links to files.

What are you using to work on new server?   URL ... by IP or by another FQDN?

Plus, is your current site using https?  Thus certs for server ... commercial or letsencrypt?

Nothing is ever simple! sad

'SoS', Ken


In reply to Ken Task

Re: Moodle clean update

by Ken Task -
Picture of Particularly helpful Moodlers

Follow up ...

IF you have linux and running apache but not virtual apaches on new server, you could:

Example for CentOS but similar with Ubuntu

Apache web root is /var/www/html/  Moodle Code goes in there.

moodledata in /var/www/ because Apache already knows about that area.
 
The trick to fake the same FQDN as your real server.

In /etc/hosts of the new server, set a map for the new server IP address to the FQDN of the old (to be decommissioned server).

Looks like:

IP.address fqdnofserver short name

An example that isn't real:

207.1.1.0 moodle.xisd.org moodle

If using Windows as your workstation:
https://helpdeskgeek.com/windows-7/windows-7-hosts-file/
and create an entry for the same above on workstation.

When you use your browser then, your host file is read first and you go not to
your real server by that FQDN, but the new server you are working on.

The thing you have to remember, you must undo the edits to your host file if you want to work on the real server.

'SoS', Ken


In reply to Ken Task

Re: Moodle clean update

by Carlos Sanchez -
Thanks Ken,

I am using:
- A linux server in the cloud.
- Ubuntu, plesk
- Let's Encript

I think that for the FQDN spoofing to work I have to use a browser from the new server itself. For this I should have graphical access to the server that I do not have. That's right?
In reply to Carlos Sanchez

Re: Moodle clean update

by Ken Task -
Picture of Particularly helpful Moodlers

Every computer with TCP/IP stack uses DNS ... server + users computers.

Most read host file first before checking DNS servers.

On your workstation ... it has a host file and it can be used to spoof ... how easily that is done depends upon platform ... easy to do on a mac ... /etc/hosts is an ascii file and can be edited via terminal as superuser to make that IP -> FQDN entry.   Not so easy on Windows ... which is typical of that platform.

Your Ubuntu has /etc/hosts and it can be used the same way.

Unfortunately, you have 'Plesk' which is highly protective and in this case gets in the way. sad

I practice what I preach ... have used FQDN 'spoofing' ... but don't use Plesk.

'SoS', Ken