Skip to content

How to restore application from backups

In the event of an emergency, here is how to restore:

  1. Go to S3 backups
  2. Select IxDF folder
  3. Download the latest backup (format YYYY-mm-dd-hh-mm-xx.zip)
  4. Log into production forge
  5. Grab the archive password from BACKUP_ARCHIVE_PASSWORD environment variable
  6. Extract the archive using the password

MySQL Restoration

To restore MySQL, you have to follow the steps above.

Testing locally

  1. Locate the MySQL dump under db-dumps
  2. Drop your local DB docker compose down -v && docker compose up -d
  3. Extract and import the dump
bash
bunzip2 < ~/Downloads/2022-10-10-04-23-01/db-dumps/mysql-forge.sql.bz2 | mysql -h 127.0.0.1 -P 33060 -u ixdf_web -psecret ixdf

Restoring it on other servers

  1. Locate the MySQL dump under db-dumps
  2. Move the file to the server
bash
scp /path/to/db-dumps/mysql-forge.sql.bz2 forge@staging.ixdf.dev:/tmp/mysql-forge.sql.bz2
  1. SSH into the server ssh forge@staging.ixdf.dev
  2. Extract and import the dump
bash
bunzip2 < /tmp/mysql-forge.sql.bz2 | mysql -h 127.0.0.1 -P 3306 -u forge -pforge forge

Important files

LetsEncrypt

You can either restore LetsEncrypt files from /etc/letsencrypt directory or follow the SSL Configuration Guide to generate a new certificate.

nginx

You can find all nginx configuration under /etc/nginx directory. You can use scp to move the files to the server & reload the nginx.

PHP

All PHP configuration are under /etc/php directory.

Supervisor

Use scp to move supervisor configuration from /etc/supervisor to the remote host.