{% extends "layouts/default.html" %} {% block title %}Snapshots Restore Guide{% endblock %} {% block content %}

Restore from Snapshot

Warning: Restoring the website from a snapshot causes destructive changes to the site's storage directory and database.

To restore the website from a snapshot, you will need to be able to log into the server, hosting this website. Refer to the server's System Administrator if you don't have access to the server (usually via SSH), or you are unfamiliar with running scripts from the CLI.

Step-by-Step Guide to Restore Snapshot

Before you start, you need to log into the server, via SSH.

        
// SSH into the server from your local machine.
ssh [USERNAME]@{{ip-address}}
        
    

If you're not running the website as a (systemd) service, you will need to stop it manually before running the restore-from-snapshot.sh script. Otherwise, the script will stop the (systemd) service for you. Typically, you will be running the website with a live Common Lisp image, like SBCL, if you're not running it as a service. Entering (larder.web:stop) into the prompt should stop the website. To manually restart the website, enter (larder.web:start :server :woo) into the Common Lisp prompt.

        
cd {{app-root}}scripts
./restore-from-snapshot.sh
        
    

Enter the following into the scripts prompts,

  1. Snapshot Directory: {{snapshot-name}}
  2. Database Name: {{db-name}}
  3. Sudo Password: (Refer to your server's System Administrator)

The Snapshot Directory is the directory containing the snapshot you want to restore from. You can see a full list of snapshots by running ls {{app-root}}snapshot/ (before starting the restore process). A snapshot directory should look something like site-name_2023-09-12_00-49-18/.

The Database Name refers to the name of the currently running database. If you're running the website in production, the name should be larderprod -- otherwise it should be larderdev. If you've setup the server to run using the lardertest database, use that as the input value. With that said, this is not expected to be ran in a live/production environment.

Sudo Password is, as the name implies, the password for the account on the server. This is server specific and doesn't relate to the website at all. Typically, the server's System Administrator will know this password. This is needed because some commands need to ran with sudo privileges.

Note: The expected system for running this website is a Debian/Ubuntu based version of Linux. If your System Administrator has deployed this site on a different operating system, you will need to refer to said System Administrator for guidance on restoring the system from a snapshop.

{% endblock %}