Versions Compared

Key

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

...

Steps in order to take a new snapshot.

  1. Navigate into RDS → DB instances.

  2. Select the database we want to take a snapshot from

  3. Actions → Take Snapshot

  4. We give a name of the snapshot and hit create.

Snapshot it will take approximately 15 minutes to finish.

Restore from a snapshot (Manual or Automated).

  1. Navigate into RDS → Snapshots

  2. Select the snapshot we want to restore

  3. Actions → Restore Snapshot

  4. We navigate into a new window where we must select the appropriate Security Groups and availability zones.

  5. Restore DB instance.

Restore EFS

Take an EFS backup right away

In order to make an EFS backup right away we need to navigate into AWS Backup service.

  1. We select the Create on-demand backup.

  2. Resource type we select EFS

  3. Select the File system ID

  4. Backup window set to “Create backup now“

  5. Transition to cold storage Never

  6. Retention period Always

  7. Backup vault set to Default

  8. IAM role set to Default role

  9. Set tags

  10. Create on-demand backup.

Creating the backup will take approximately 2 hours for 1.4TB

...

In order to restore EFS we need to go into AWS Backup services and then into Backup vaults

  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 EFS.

  4. Restore to a new file system.

  5. Restore role → Default role

  6. Restore backup

This action will take approximately 15 minutes.

...

The steps to mount the EFS are:

  1. In EFS dashboard we select the EFS that we have restored and we navigate into 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
breakoutModewide
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-.....:/ efs

...

We edit config.php and we make the relevant changes:

  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

...

in Configured store instances table we edit redis_all and on the server input we put the one we have for our cloned website. eg dev-courses[…]amazonaws.com

In this area we need to put the Primary endpoint which we can found in our Amazon ElasticCache service

This is an important step as if it’s not configured then changes that are suppose to happen in cloned website will be done into the previous website because of redis caching.

...