Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A guide on how to clone moole Moodle into another instance. We take into account that all backups for RDS, EFS and AMI’s for EC2 instances are already set up.

...

We either take a new snapshot or we go into already created snapsots snapshots and restore the latest.

Steps in order to take a new snapshot.

...

  1. Select the EFS we want to restore

  2. Actions → Restore

  3. We can select Full restore if we want the whole EFS or item-level restore if we want a specific directory from the efsEFS.

  4. Restore to a new file system.

  5. Restore role → Default role

  6. Restore backup

...

We assume that our instances already have the nescessary phpnecessary PHP, apache, packages installed.

...

  1. In EFS dashboard we select the efs EFS that we have restored and we navigate into anoter another page

  2. we select Attach we chose the option Mount via DNS

  3. Using the NFS client we select the appropriate command on which we paste into our EC2 console.

  4. example of command

...

Code Block
sudo vi /etc/fstab 
fs-......:/ /efs nfs defaults,_netdev 0 0

3. Check efs EFS mounted successfully

Code Block
sudo mount -fav

...

We need to log into our ec2 instance. and then navigate into our httpd configuration for moodleMoodle

Code Block
cd /etc/httpd/conf.d
sudo vim 002-dev.courses.unic.ac.cy.conf

...

Go through the file and make sure we didn’t forget to use the path anywhere else.

Make appropriate changes in

...

Moodle config

We navigate to /efstemp/..../moodle

...

  1. we need to make sure the dbtype is the correct one in our case we have 'mariadb'

  2. dbhost,dbname,dbuser,dbpass need to be of the newly restored DB instance.

  3. wwwroot needs to change into the new URL eg https://dev.courses…

  4. dataroot need to point to newly restored EFS with a path to moodledata

  5. session_redis_host need to have the name of the redis for our application

Make sure Redis cache is correct in

...

Moodle application

Right after we finish cloning we need to log in into the website.

...