View on GitHub

file-backups

File Save & Backup Utility For TiddlyWiki

File Backup Utility For TiddlyWiki

Introduction

This browser add on is designed to let you easily save and backup TiddlyWikis. It is a file-based system for a single user. If you’d like your TiddlyWiki available over the network or in the cloud, please check out other options at “Getting Started With TiddlyWiki”[1].

It will save TiddlyWiki5 and TiddlyWikiClassic files.

Guides

How to use File Backups in your wiki:

Requirements

Firefox 115 or newer, including Firefox ESR 115 and later.

Allow access to local files (Firefox 153+)

Since Firefox 153, extensions need your permission to work with local files, and it is off by default. Without it, File Backups can’t save: your wiki ends up as Notes(1).html, Notes(2).html, … in the Downloads folder, and the add-on’s toolbar icon shows a !.

To turn it on:

  1. Open Extensions and Themes → Extensions → File Backups → “Permissions and data” tab.
  2. Turn on “Access local files on your computer”.
  3. Reload the wiki tab.

The add-on’s popup shows the same steps, and its Settings button opens the add-on page.

Folder sync (see the guides) needs the same permission: without it, opening the backup folder shows the file list but nothing is synced.

If saving still ends up in Downloads (also on older Firefox versions), check the same “Permissions and data” tab and allow everything listed for local files.

For an overview of this add on please see the introduction video: https://youtu.be/KVLtID8nElU

Installation

To install, go to: Mozilla AddOn Store

If you want to help with the AddOn development. Have a look at the Beta-versions and how to install a beta.

Firefox’s default zoom (Settings → Zoom) enlarges web pages but not add-on popups. By default (Auto) the File Backups popup uses the same zoom. To choose a fixed size instead, use about:addons → File Backups → Preferences → Popup size (100 % to 200 %).

File Storage Locations

Main File Limitations

To help keep you secure, most modern browsers limit writing files to only a few locations.

This means this add on can only write to your “Downloads” folder and its subdirectories.

For example on Windows 7 or newer, it’s usually C:\Users\<name>\Downloads

It’s a good idea to keep your TiddlyWiki in it’s own subfolder. So, you’ll end up with something like

Want your wikis somewhere else, for example on another drive or in a cloud-synced folder? See Advanced setup.

The Backup Folder (Optional)

The default backup folder is called twBackups. This can be changed in the options. It’s set globally and is relative to the wiki location.

For example if your TiddlyWiki is C:\Users\<name>\Downloads\myWikis\notes.html the backup folder defaults to C:\Users\<name>\Downloads\myWikis\twBackups\notes(A).html

The Backup Strategy

The backups are created using a slightly modified “Tower of Hanoi” rotation strategy, similar to some tape based backup software.

The following table shows the numbering system, with 4 different files.

Backup Number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
File A A   A   A   A   A   A   A   A  
File B   B       B       B       B    
File C       C               C        
File D               D               D

So the order will be: A, B, A, C, A, B, A, D, A, B, A, C, A, B, A, D, …

As you can see:

The generic order is: 2 n-1.

Files can be restored from 1, 2, 4, 8, 16, …, 2 n-1 saves ago!

Working with 11 files will result in 512 saves, before K is overwritten the first time. Then it will need another 1024 saves until it is overwritten again.

Eg: Starting with A, if you save your file twice a minute for eight hours, you will still have not overwriten K. K is save #1024 and 2 * 60 * 8 = 960.

The Modification

With the very first save, the plugin detects a new wiki, an “out of order” backup will be created. It looks like this: wiki-name(2019-08-13T11-54-07-179Z).html

News and History

[1] https://tiddlywiki.com/#GettingStarted
[2] Overview Releases

License

Copyright (c) 2017-2026 Mario Pietsch

Licensed under the BSD 3-Clause License. See LICENSE.