Difference between revisions of "EC2 server recovery"

From TS NoCode wiki
Jump to navigation Jump to search
Line 37: Line 37:
# ts install-ssl
# ts install-ssl
# mysql -uroot -p -e "UPDATE applive.systempolicy SET PolicyValue='true' WHERE PolicyName LIKE 'securitySsl%'"
# mysql -uroot -p -e "UPDATE applive.systempolicy SET PolicyValue='true' WHERE PolicyName LIKE 'securitySsl%'"
# ts restart-webserver
==== Extra steps for servers with S3 filesystem ====
# [[Server_maintenence#Moving_files_to_S3_storage]]
#* Step: Add IAM role to server
#* Step: Install the mountpoint

Revision as of 00:58, 10 January 2025

No SSL connections possible

Changes in AWS

  1. Make a snapshot of the running server
  2. Make a volume from the snap shot
  3. Name the volume: RESTORE COPY
  4. Create a NEW server
  5. Attatch the RESTORE COPY to NEW server on /dev/sdf

Connect to new server

  1. Install TS client tools
  2. ts quick-install
  3. ts stop-webserver
  4. ts stop-database
  5. mkdir /mnt/oldroot
  6. sudo mount /dev/nvme1n1p1 /mnt/oldroot
  7. sudo rm -r /var/lib/mysql
  8. sudo cp -r /mnt/oldroot/var/lib/mysql /var/lib
  9. ts start-database
  10. mysql -uroot -p -e "UPDATE applive.systempolicy SET PolicyValue='false' WHERE PolicyName LIKE 'securitySsl%'"
  11. sudo rm -r /mnt/sda/*
  12. sudo cp -r /mnt/oldroot/usr/tempusserva/sda/* /mnt/sda/
  13. sudo cp /mnt/oldroot/usr/share/tomcat8/conf/Catalina/localhost/* /usr/share/tomcat8/conf/Catalina/localhost
  14. ts start-webserver
  15. Ensure server is running

Changes in AWS

  1. Stop NEW server
  2. Detatch RESTORE COPY
  3. Stop OLD server
  4. Deassociate IP from OLD server
  5. Associate IP to NEW server
  6. Start NEW server

Connect to new server

  1. ts install-ssl
  2. mysql -uroot -p -e "UPDATE applive.systempolicy SET PolicyValue='true' WHERE PolicyName LIKE 'securitySsl%'"
  3. ts restart-webserver


Extra steps for servers with S3 filesystem

  1. Server_maintenence#Moving_files_to_S3_storage
    • Step: Add IAM role to server
    • Step: Install the mountpoint