Loading...
 

History: Virtualmin Tiki Manager and Syncthing for automated offsite backups

Preview of version: 4

In case you have some Tiki instances on Virtualmin and you want automatic backups of different Tiki instances to various local computers for safekeeping. These are high level instructions as to how to combine Tiki Manager and Syncthing to do so.
For a hosting company and its customer, this is the optimal solution: This permits a customer to delegate the hosting / management of an application while obtain automatic backups of their application and data.

At a high level:

  1. Virtualmin will make incremental and automated backups of each virtual server to different locations.
  2. Tiki Manager (installed on the same server) will make incremental and automated backups of each site to a distinct folder
  3. Syncthing will securely copy each folder to one or many devices.

Benefits / Features

https://wikisuite.org/Tiki-Manager-and-Syncthing-for-automated-offsite-backups#Benefits_Features

Install Virtualmin as web server

How to install WikiSuite
This installation of WikiSuite install all the require module in order to ready to install a Tiki instance, such as: Tiki-Manager GUI and CLI and Syncthing installation script
Each Tiki instance can be installed as a distinct website using Tiki-Manager on a virtual server or sub-virtual server.

Configure Virtualmin to backup your virtual server

As we are planning to backup each Tiki instance, we can backup each virtualserver or sub-virtualserver with all configuration need.

  • From virtualmin, go to menu Backup and Restore -> scheduled Backups . In case you do not have existing scheduler, it will open the scheduler pages.

Schedule Backup Menu

  • From the virtual servers list, you select all or select the one you want to backup, there is an option to select one, then click on the right arrow to select the virtaul server

Schedule Backup Select Virtual Server

  • Then select feature you want to backup, by default backup all features will be selected

Schedule Backup Feature

  • Now you have to select the destination of your backup, as we are going to use Syncthing to backup data to external server, we are going to select Local file or directory and provide the path where we want our backup to be store. for my example we use the /home/backuos/lab3-%Y-%m-%d directory, is going to generate a backup with a different name for versioning(very important). For the compression format, by default virtualmin as a standard format that work without any issue, you can select the one you prefer. tar can be fine to have only one file instead of multiple folders.

Schedule Backup Destination File

  • For this step you can setup a email for reporting notification in case the backup failed, and then select the schedule time for the backup. on this example it will be everyday at 11h PM.

then click on create to validate the scheduler.
Scheduling And Reporting

Schedule Backup List
Note that you can setup up multiple backup scheduler based on the need, it can be day, month, year, ....

Use Tiki Manager to make instances, or adopt them

Tiki-Manager can be access via GUI or CLI

Configure Tiki Manager to backup your Tiki instances

The configuration can be done via cli, for more detail about tiki-manager command https://doc.tiki.org/Manager#instance:backup

The Tiki Manager archive folders have the following pattern:

  • /opt/tiki-manager/app/backup/archive/1-example.org/
  • /opt/tiki-manager/app/backup/archive/2-example.com/
  • etc.


Check that your backup is OK, and move on to the next step

Set up automatic backups with Tiki Manager

Tiki Manager will make the backups and also has a retention cycle (keep last 7 days, last 4 weeks and once per month forever)

Of all the instances

Virtualmin provide as module to schedule backup of all
https://doc.tiki.org/Manager#manager:setup-backups

For just one of the instances

In case you want to backup one instance, you can proceed as shown above. make sure you are on Tiki-manager folder

php tiki-manager instance:backup --instances=3  --no-interaction


You may want to install this in a cronjob. To do it every day at midnight, do the following.

echo '0 0 * * * cd /opt/tiki-manager/app/ ; php tiki-manager instance:backup --instances=3  --no-interaction' > /etc/cron.d/tm-instance.wikisuite.org-backup

Install Syncthing

On the server

Foreach virtualserver you can install an instance of Syncthing, and each one can work without interfering with other.

On your laptop

Setup Syncthing


Make sure Syncthing automatically restarts when you reboot so that you have unattended automatic backups. Just reboot to see if it's OK. If not, you need to look up the documentation for your Operating System.

Configuring Syncthing for

  • Tiki archive folder: Your archives will be in something like /opt/tiki-manager/app/backup/archive/1-example.org/: so, sync that folder with your local computer.

Setting up Syncthing for backups

Syncthing by default is set to sync multiple folders so they get to the exact same set of files and folders. So, if you delete a file in one folder, the deletion is propagated. In the contexts of backups, this could cause issues. Examples:

  • Ransomware on any device: Then, all the devices would receive the corrupted data which replaces the valid data.
  • One of the devices runs out of space, and its user decides to clear out old backups.


The solution is:

  1. On the device sending the backups: set Folder Type to "Send Only"
  2. On the device(s) receiving the backups: set File Versioning. Recommended setting is "Staggered"

Because the master server is set to "Send Only", there is no point in setting to "Staggered" (It doesn't receive any data, and thus doesn't need versioning).
Syncthing Backups Send Only Setting
Syncthing Backup Receiving Staggered

Troubleshooting

  • If sync is not working as expect, check the Syncthing folder interface for errors.

History

Advanced
Information Version
Emmanuel Masikilizano 16
View
Emmanuel Masikilizano 15
View
Emmanuel Masikilizano 14
View
Emmanuel Masikilizano 13
View
Emmanuel Masikilizano 12
View
Emmanuel Masikilizano 11
View
Emmanuel Masikilizano 10
View
Emmanuel Masikilizano 9
View
Emmanuel Masikilizano 8
View
Boss Ibrahim Mussa 7
View
Boss Ibrahim Mussa 6
View
Boss Ibrahim Mussa 5
View
Boss Ibrahim Mussa 4
View
Boss Ibrahim Mussa 3
View
Boss Ibrahim Mussa 2
View
Boss Ibrahim Mussa 1
View