Difference between revisions of "EC2 server recovery"

From TS NoCode wiki
Jump to navigation Jump to search
Line 6: Line 6:
# Make a volume from the snap shot
# Make a volume from the snap shot
# Name the volume: RESTORE COPY
# Name the volume: RESTORE COPY
# Create a new server
# Create a NEW server
# Attatch the RESTORE COPY to server on /dev/sdf
# Attatch the RESTORE COPY to NEW server on /dev/sdf


==== Connect to new server ====  
==== Connect to new server ====  
Line 28: Line 28:


==== Changes in AWS ====  
==== Changes in AWS ====  
#  
# Stop NEW server
 
# Detatch RESTORE COPY
# Stop OLD server
# Detatch IP from OLD server
# Attatch IP to NEW server
# Start NEW server


==== Connect to new server ====  
==== Connect to new server ====  
# sudo umount /mnt/oldroot
# sudo umount /mnt/oldroot

Revision as of 00:30, 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 -pTempusServaFTW! -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/server.xml /usr/share/tomcat8/conf
  14. sudo cp /mnt/oldroot/usr/share/tomcat8/conf/Catalina/localhost/* /usr/share/tomcat8/conf/Catalina/localhost
  15. ts start-webserver
  16. Ensure server is running

Changes in AWS

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

Connect to new server

  1. sudo umount /mnt/oldroot