How to Backup and Restore TiddlyWiki on Nodejs?

142 views
Skip to first unread message

zzzz

unread,
Mar 13, 2021, 5:23:17 PM3/13/21
to TiddlyWiki
I've setup TiddlyWiki on an Ubuntu server. It's running on Nodejs. I've got a shell script that zips up my /home/username/wiki/ directory. The shell script then runs a PHP script that renames the zip file to DAYOFMONTH_wiki.zip. For example, if today is March 13th, then it renames the zip file to:

13_wiki.zip

The idea here is that it backs up the files on a monthly rotation, so there shouldn't be more than about 30 backup files (for 30 days in the month) since when the new month rolls around it will replace 1_wiki.zip, then 2_wiki.zip and so on.

This PHP script then uploads the renamed zip file to my Amazon S3 bucket each day and also when the server reboots (it's a cron job).

Anyways, could someone please confirm that if I backup the /home/username/wiki/ directory, then is this a sufficient backup for my TiddlyWiki? I would just hate to find out that I'm not backing up enough files or doing it incorrectly if my server breaks for some reason.

Also, what would be the process for restoring the backup on a new server, if I ever have to do a restore?

Joshua Fontany

unread,
Mar 13, 2021, 9:58:43 PM3/13/21
to TiddlyWiki
If you are starting tiddlywiki on node with `tiddlywiki /home/username.wiki/ --listen <<ARGS>>` then yes, this seems like a good "quick" backup strategy. Because of the way TW modularly loads itself in node & the browser, you should have everything you need from the "/home/username.wiki/" ZIP files. Bare monimum you would need is the "tiddlywiki.info" file (a JSON describing the TW startup options for that wiki) and the contained "tiddlers/" folder inside the wiki folder.

You can simply unzip an archive anywhere, and replace that directory in the command to start the TW server.

Alternately, you can use the `tiddlywiki ~/Path/To/MyWiki --rendertiddler $:/core/save/all index.html text/plain` to render the folder-style wiki into a single "index.html" file (or change the 2nd parameter in the command), which will be placed in a newly created "output/" folder in the wiki directory.

Best,
Joshua Fontany

Reply all
Reply to author
Forward
0 new messages