Backups & Restore

Backup a fylr instance into a SQL dump, to later restore it into an empty fylr instance

To migrate between two fylr instances we also develop the fylr Migration Tool. For easydb5 to fylr migration, that is already the best tool. For fylr to fylr, this page is currently (2024-03) still recommended.

You need access to the command line.

In this example we call the instances "old" and "new" and the linux servers running them: "old server" and "new server". But you can also think of the new server as a backup server.

prepare old server

Check that you have access to the SQL backups: In the case of an installation via docker-compose, the access is a mounted volume (e.g. in the docker-compose.yml of our installation instructions):

services:
  postgresql:
    volumes:
      - "/srv/fylr/sqlbackups:/mnt"

backup

  1. Save a consistent copy of the SQL data on the old server: (This may have been already done automatically)

docker exec postgresql pg_dump -U fylr -v -Fc -f /mnt/fylr.pg_dump fylr

This SQL does include data model, objects, users, groups, user rights and base configuration.

(But not assets and not log messages.)

  1. Copy the assets from old server to new server (we assume file based assets, not s3 based):

rsync -a --numeric-ids old-server:/srv/fylr/assets/* /srv/fylr/assets

... executed on the new server, as are all the following commands.

  1. Also get the dump of the SQL to the new server, here an example using scp:

scp old-server:/srv/fylr/sqlbackups/fylr.pg_dump /srv/fylr/sqlbackups/
  1. We recommend to also copy the configuration of the old server, even if the new server may need a somewhat different configuration:

scp old-server:/srv/fylr/config/fylr/fylr.yml /srv/fylr/config/fylr/fylr.yml.oldserv

Now you have all data for a restore on the new server.


restore

  1. install fylr on the new server, as described in our installation instructions, but only start postgresql:

docker-compose up -d postgresql

Make sure that the postgresql DB and elasticsearch indices are empty from previous attempts on the new server so that there is no collision of data. (for example delete all in /srv/fylr/indexer/)

For postgreSQL, this may include deleting the database and creating the database fylr.

  1. import the sql-dump on the new server:

docker exec -it postgresql pg_restore -U fylr -v -d fylr /mnt/fylr.pg_dump
  1. start fylr and elasticsearch on the new server:

docker-compose up -d
  1. You may need to force a re-index in Elasticsearch: surf to /inspect/system/ on the new server, so e.g. https://new-server.example.com/inspect/system/ and click a Reindex button.

Last updated