Disaster Recovery Guide

This guide was prepared in the event of a catastrophic failure, new computer purchase, or a computer needs re-installing.

Recovery Locations:

  • VPS Server (via Managed Hosting Support)
  • The Smurflings (External HDD’s on office desk)
    • Sassette (6TB USB 3.0 – Ext4)
    • Snappy (6TB USB 3.0 – NTFS)
    • Slouchy (1.5TB USB 2.0 – NTFS)
  • The SmurfVillage (Local network)
    • HeftySmurf (Desktop: Ubuntu 20.04/i9/32GB/1TB)
    • AstroSmurf (Laptop: Ubuntu 22.04/i7/16GB/512GB)
  • bash scripts
    • installwebserver.sh
    • filesystembackup.sh
    • filesystemrestore.sh

Production Web Server

  • Managed VPS Hosting
    • PapaSmurf (CentOS, 80GB SATA HDD, 2.5GB RAM, 70TB Bandwidth)
  • submit ticket to VPS Support!

Development Web Server:

Rather than try to recover software that is not working correctly, I find it quicker to do a fresh install before moving on to the Restore Files and Web Server Configuration steps listed below. These next few steps are exactly the same as from the Setting up a LAMP Web Development Workstation on Ubuntu article.

Create a Web Development Workstation on Ubuntu:

  1. Install Base OS (Ubuntu) || Install Ubuntu on VMWare Guide
    1. sudo mkdir ~/web
    1. sudo chmod -R 777 ~/web
  2. Install and Configure git on Ubuntu Guide
    • ssh-keygen -t ed25519 -C “<comment>”
    • nano ~/.ssh/id_ed25519.pub #copy to GitLab account
    • git clone git@gitlab.com:sipofwater/scripts.git ~/web/scripts
  3. Ubuntu Software -> vscode -> install
  4. Install and Configure a LAMP Server on Ubuntu Guide
    1. bash ~/web/scripts/webserver/installwebserver.sh
  5. Implement Backup Guide

Restore Files and Web Server Configuration:

  1. Restore files from backup:
    1. Copy /Sassette/HeftySmurf/daily/<date> from ExtHddA to ~/Desktop
    2. Restore /sites-available/
    1. Restore ~/web/webroot/
    2. Restore ~/web/sandbox/
  2. Restore Configuration Settings:
    1. Run filesystemrestore.sh (which also calls below)
      1. Runs restore-a2ensite.sh
      2. Runs restore-db.sh

Restore Databases:

  1. Re-attach MySQL databases(??)
    1. sh ~/web/scripts/mysqlrecovery.sh (NEED TO WRITE)
    2. Database(s) and data
    3. MySQL Procedures (reset permissions)

Rebooting & Testing:

  1. Reboot
    1. sudo service apache2 reload
  2. Test the shit out of everything!
  3. git back to work!!

Outstanding ToDo’s:

  • Visual Studio Code
    • theme
    • enabled / disabled / (other) settings
  • Chrome + dev tools
    • Card Color Titles for Trello (Chrome extension)
    • JSON Viewer
    • React Developer Tools
    • Web Developer
  • node / npm / nvm /
  • Gnome
  • Testing recovery from backups to ensure works!
  • Compression
    • test compression
  • write script to automate testing websites work

Questions:

  • lots of sudo’s, how to remove?