Skip to main content

Migration Guidelines

important
  1. Always create the new instance in private subnet if there will be a load balancer.
  2. Check the config/db...php files to find out which DBs need security rules.
  3. If the instance has no space left to make an archive use EFS to move files
  4. Use wildcard(*) ssl certificates for loadbalancers

Migrating from dedicated to another dedicated instance

When source and target have same Architechture

Requires downtime

  1. Create an AMI of the source instance.
  2. Launch a new instance with the AMI created in the above step.
  3. Attach the same security groups to the new instance as the source instance.

When source and target have different Architechture

Follow the steps here

Migrating from shared to dedicated instance

Does not require downtime

  1. Create a new EC2 instance.

  2. Attach the security groups to allow DB, redis, bastion host, load balancer etc.

  3. Make an archive of the www and html of the corresponding university on the source EC2 instance.

  4. Move the archive to the target. To acomplish this you can use SCP, AWS S3 or EFS.

  5. Extract the archive in the corresponding location.

  6. Delete the .git directories.

    1. Check the which files will be deleted (in web diretory only)

      cd /var/www/
      find . -type d -name ".git"
    2. If the output of the above command does not contain any other directorues except .git, run the following:

      find . -type d -name ".git" -exec rm -rf {} +
  7. Copy the cronjobs from the source.

  8. Copy the apache vost configuration to the target.

  9. Test and restart apache

    info

    Skip to Step 13 if no load balancer is required

  10. Create a target group and add the target server.

  11. Create a load balancer.

    1. Redirect 80 to 443
    2. Forward 443 to target group
  12. Wait for the target group to be healty.

  13. Update the record in route 53 with the new load balancer or the instance public IP.