Differences between revisions 6 and 7
Revision 6 as of 2018-01-18 06:48:08
Size: 6633
Comment: Update information for repro and infinoted
Revision 7 as of 2018-03-03 13:37:55
Size: 6817
Comment: Add mediawiki backup entry
Deletions are marked like this. Additions are marked like this.
Line 54: Line 54:

== mediawiki ==

 * '''Data:''' /var/lib/mediawiki-db
   * '''Format:''' sqlite3 database
   * '''Ownership:''' www-data:www-data
   * '''Permissions:''' 640 for .sqlite files

This page is for gathering information about how user data is stored on FreedomBox. The goal is to list any information needed to backup/restore data for each application available on FreedomBox.

Applications

ikiwiki

  • Data: /var/lib/ikiwiki/

    • Format: Setup files and git repositories for each wiki/blog

    • Ownership: root:root

    • Permissions: 644 for files, 755 for directories, drwxrwsr-x for all .git directories and their children.

  • Configuration: None

    • /var/lib/ikiwiki/*.setup which is already part of data location.
  • Secrets: None

ejabberd

  • Data: /var/lib/ejabberd/

    • Format: Mnesia database.

    • See information on how to backup/restore database.

  • Configuration: /etc/ejabberd/ejabberd.yml

    • Format: YAML

    • Ownership: ejabberd:ejabberd

    • Permissions: 600

    • Contains configured domain names and options. Automatically configured properly by FreedomBox if same domain name and options are set.

  • Secrets: /etc/ejabberd/ejabberd.pem

    • Ownership: root:ejabberd

    • Permissions: 640

    • TLS Certificate used for secure communication
    • Needed only if you wish that certificate should not change on restored machine.

radicale

  • Data: /var/lib/radicale/

    • Format: Collections per user

    • Ownership: radicale:radicale

    • Permissions: 755 for directories, 644 for files

  • Configuration: /etc/radicale/

    • Ownership: root:root

    • Permissions: 755 for directories, 644 for files

    • No changes needed after default installation. Let FreedomBox create the files on new machine.

  • Secrets: None

matrix-synapse

  • Data: /var/lib/matrix-synapse/homeserver.db /var/lib/matrix-synapse/media /var/lib/matrix-synapse/uploads

    • Format: sqlite3 database, uploaded files

    • Ownership: matrix-synapse:nogroup

    • Permissions: 755 for directories, 644 for files

  • Configuration: /etc/matrix-synapse/homeserver.yaml /etc/matrix-synapse/conf.d /etc/matrix-synapse/log.yaml

    • Ownership: root:root

    • Permissions: 755 for directories, 644 for files

  • Secrets: /etc/matrix-synapse/homeserver.signing.key /etc/matrix-synapse/homeserver.tls.crt /etc/matrix-synapse/homeserver.tls.dh /etc/matrix-synapse/homeserver.tls.key

    • TLS Certificate used for secure communication
    • Needed only if you wish that certificate should not change on restored machine.

mediawiki

  • Data: /var/lib/mediawiki-db

    • Format: sqlite3 database

    • Ownership: www-data:www-data

    • Permissions: 640 for .sqlite files

infinoted

  • Data: /var/lib/infinoted

    • Ownership: infinoted:infinoted for everything except sync folder which has ownership root:root

    • Permissions: 755 for directories, 644 for files

  • Configuration: None

  • Secrets: /etc/infinoted/infinoted-cert.pem /etc/infinoted/infinoted-key.pem

    • Ownership: infinoted:infinoted

    • Permissions: 640 for files

    • TLS Certificate used for secure communication
    • Needed only if you wish that certificate should not change on restored machine.

repro

  • Data: /var/lib/repro

    • Ownership: repro:repro

    • Permissions: 700 for directories, 640 for files

  • Configuration: /etc/repro/repro.config /etc/repro/users.txt

    • Ownership: root:root

    • Permissions: 644

  • Secrets: /etc/repro/dh2048.pem /etc/repro/ssl

    • Ownership: root:repro for dh2048.pem, root:root for ssll

    • Permissions: 640 for dh2048.pem, 755 /etc/repro/ssl

    • Let FreedomBox generate new one on new machine.

Dynamic DNS

  • Data: None

  • Configuration: /etc/ez-ipupdate/

    • These files are automatically created with correct values by FreedomBox if the exact old configuration is provided in the interface.

  • Secrets: /etc/ez-ipupdate

    • These files are automatically created with correct values by FreedomBox if the exact old configuration is provided in the interface.

Minetest

  • Data: /var/games/minetest-server/

    • Ownership: Debian-minetest:games

    • Permissions: 755 for directories, 644 for files

  • Configuration: /etc/minetest/minetest.conf

    • Ownership: root:root

    • Permissions: 755 for directories, 644 for files

    • These files are automatically created with correct values by FreedomBox if the exact old configuration is provided in the interface.

  • Secrets: None

Manual Backup and Restore

While FreedomBox does not have a mechanism yet for automatic backup and restore of data, one can manually perform a backup and restore of application using the above data.

Taking Backup

  • If the old FreedomBox is running:

    • Stop the application you wish to take a backup of using FreedomBox interface. This can also be done by running systemctl stop daemon-name.

    • Login to the FreedomBox machine using SSH using an admin user.

    • Gain root access using sudo su -.

  • If the old FreedomBox is not running:

    • Plug in the SD card or disk of the old FreedomBox to a GNU/Linux machine and mount it.

  • Create a tarball of the data, configuration and secrets directories. For example, for radicale:
    • cd /var/lib; tar -cvzf ~/radicale-data.tar.gz radicale/
    • cd /etc; tar -cvzf ~/radicale-conf.tar.gz /etc/radicale
  • Repeat the process for each application you wish to restore.
  • Copy the created files to your work machine. This can be done using the scp command or using SSH file copying GUI tools.

Restore Backup

  • Setup your new FreedomBox.

  • Install all applications you wish to restore.
  • Configure them like you did in your old FreedomBox.

  • Disable them all so they are stopped and ready for restoring.
  • Copy the file from your work machine to new FreedomBox using scp command or using SSH file copying GUI tools.

  • Login to the FreedomBox machine using SSH using an admin user.

  • Extract the files. For example, for radicale:
    • tar -xf radicale-data.tar.gz
  • This will create radicale directory with correct file permissions and ownership.

  • Take the restored data to the correct directory:
    • mv /var/lib/radicale /var/lib/radicale.old
    • mv radicale /var/lib/radicale
  • Verify that the permissions and ownership of the files is as expected.
    • ls -laR /var/lib/radicale
  • Enable the application and test that everything is okay.


CategoryFreedomBox