Migration Guidelines
- Always create the new instance in private subnet if there will be a load balancer.
- Check the
config/db...php
files to find out which DBs need security rules. - If the instance has no space left to make an archive use EFS to move files
- Use wildcard(*) ssl certificates for loadbalancers
Migrating from dedicated to another dedicated instance
When source and target have same Architechture
Requires downtime
- Create an AMI of the source instance.
- Launch a new instance with the AMI created in the above step.
- 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
Create a new EC2 instance.
Attach the security groups to allow DB, redis, bastion host, load balancer etc.
Make an archive of the
www
andhtml
of the corresponding university on the source EC2 instance.Move the archive to the target. To acomplish this you can use SCP, AWS S3 or EFS.
Extract the archive in the corresponding location.
Delete the
.git
directories.Check the which files will be deleted (in web diretory only)
cd /var/www/
find . -type d -name ".git"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 {} +
Copy the cronjobs from the source.
Copy the apache vost configuration to the target.
Test and restart apache
infoSkip to Step 13 if no load balancer is required
Create a target group and add the target server.
Create a load balancer.
- Redirect 80 to 443
- Forward 443 to target group
Wait for the target group to be healty.
Update the record in route 53 with the new load balancer or the instance public IP.