RESTORE INSTRUCTIONS
====================

This archive restores the whole site: database, code, media and
environment. Everything below assumes the paths this server uses.

Option A, from the panel
  Backup > Restore next to this file. Restores the database and media.
  Code is not replaced this way, on purpose: overwriting running code
  from a web request is how a half-written deploy takes a site down.

Option B, a full rebuild over SSH
  1. systemctl stop <service>
  2. unzip this file into /root/restore
  3. Code:
       cp -a /root/restore/code/. /home/<user>/public_html/backend/
  4. Environment (holds every credential, keep it 600):
       cp /root/restore/env/.env /home/<user>/public_html/backend/.env
       chmod 600 /home/<user>/public_html/backend/.env
  5. Python packages:
       cd /home/<user>/public_html/backend
       python3 -m venv venv
       venv/bin/pip install -r config/requirements.frozen.txt
  6. Database:
       sudo -u postgres dropdb --if-exists veventa_db
       sudo -u postgres createdb veventa_db
       sudo -u postgres psql veventa_db < /root/restore/database.sql
  7. Media:
       cp -a /root/restore/media/. /home/<user>/public_html/backend/media/
  8. systemctl start <service>
  9. Check before trusting it:
       venv/bin/python manage.py migrate --plan --settings=config.settings.production

Note. FIELD_ENCRYPTION_KEY inside .env is what makes the encrypted
columns readable. Regenerate it and the old values are lost for good.
