EC2 server recovery
Jump to navigation
Jump to search
Recovery procedure without database backup
Changes in AWS
- Make a snapshot of the running server
- Make a volume from the snap shot
- Name the volume: RESTORE COPY
- Create a NEW server
- Attatch the RESTORE COPY to NEW server on /dev/sdf
Connect to new server
- Install TS client tools
- ts quick-install
- ts stop-webserver
- ts stop-database
- mkdir /mnt/oldroot
- sudo mount /dev/nvme1n1p1 /mnt/oldroot
- sudo rm -r /var/lib/mysql
- sudo cp -r /mnt/oldroot/var/lib/mysql /var/lib
- ts start-database
- mysql -uroot -p -e "UPDATE applive.systempolicy SET PolicyValue='false' WHERE PolicyName LIKE 'securitySsl%'"
- sudo rm -r /mnt/sda/*
- sudo cp -r /mnt/oldroot/usr/tempusserva/sda/* /mnt/sda/
- sudo chmod 777 -R /mnt/sda/files
- sudo cp /mnt/oldroot/usr/share/tomcat8/conf/Catalina/localhost/* /usr/share/tomcat8/conf/Catalina/localhost
- ts start-webserver
- Ensure server is running
Changes in AWS
- Stop NEW server
- Detatch RESTORE COPY
- Stop OLD server
- Deassociate IP from OLD server
- Associate IP to NEW server
- Start NEW server
Connect to new server
- ts install-ssl
- mysql -uroot -p -e "UPDATE applive.systempolicy SET PolicyValue='true' WHERE PolicyName LIKE 'securitySsl%'"
- ts restart-webserver
Steps is using S3 filesystem
- Server_maintenence#Moving_files_to_S3_storage
- Step: Add IAM role to server
- Step: Install the mountpoint