[tw5] Emergency tiddlers export to JSON, backup 25 most recent tiddlers dropdown option for FilterTab

139 views
Skip to first unread message

wjam

unread,
Mar 10, 2018, 1:02:47 PM3/10/18
to TiddlyWiki
Backup:

You can Export your recently modified tiddlers to JSON using advanced search (magnifier in sidebar) then select Filter tab.

Enter the follwing filtertext manualy [!is[system]!sort[modified]limit[25]]
 
---
To make things easier I've attached two tiddlers ''$:/plugins/wjam/emergencyExport2JSON.json'' size 2k ''$:/plugins/wjam/emergencyExport2JSON_tiny.json'' size 400b both will add a dropdown option (\/) to the Filtertext box. The tiny version does not include documentation.

Drag one of the two json file to your wiki and drop it on the topline of your wiki.A green line will appear. Drop the file on the wiki. An import tiddler appears. Then press the [import] button in the $:/Import tiddler. 

The new option is called ''EMERGENCY JSON export, backup 25 most recent modified tiddlers''. 
Now you can now easily choose this option from the dropdown in the Filter Tab.
---

Check the generated list of tiddlers.

Adjust the number "25" to make sure you have found  all your recently modified tiddlers.

Then press the bucket with the up arrow [_^_] which appears on the right.

It will ask for a location to store the tiddlers into a file called tiddlers.json on your local drive. Optionally add a description or date to the filename. Then press save.

Backup / export individual tiddlers:

You can also export individual tiddlers from the viewtoolbar of a tiddler, choose  \/ (=more) , then choose [_^_] export tiddler , then choose JSON file.

Restore/import:

The local json file can be imported using paperclip in Tools tab in the sidebar. 

Or drag and drop the file from file explorer/finder on the top line of the story river of another tiddlywiki . (Press Esc if you change your mind ;-). 

You can (de)select specific tiddlers in the $:/Import tiddler.

Then press [import].

---
Njoy 
KR wjam
$--plugins-wjam-emergencyExport2JSON.json
$--plugins-wjam-emergencyExport2JSON_tiny.json

Mark S.

unread,
Mar 10, 2018, 2:03:22 PM3/10/18
to TiddlyWiki
BTW, these were great instructions. They were added as a PR and merged and should appear in the next release.

Thanks!
-- Mark

wjam

unread,
Mar 10, 2018, 2:19:23 PM3/10/18
to TiddlyWiki
thanks!

the tiddlers in the op can also be used with older versions of tw5.

wjam

TonyM

unread,
Mar 10, 2018, 7:49:42 PM3/10/18
to TiddlyWiki
Wjam,

Thanks for your effort here. I was thinking how do I do something similar when I also edit system files $:/ while developing solutions. Further one solution that I am developing to manage the disposition of tiddlers, allows date field time stamps to be updated without altering the modified date, but these are changes I would not like to loose.

It brings me to ask the community, I will post in TiddlyWikiDev groups is their a way to identify changes to an open tiddlyWiki, tiddlers with changes that have not being "committed" or saved, regardless of dates etc...

Regards
Tony

wjam

unread,
Mar 11, 2018, 1:09:47 AM3/11/18
to tiddl...@googlegroups.com
Tony and all

The filter provided filter also includes all draft tiddlers so those will be backed up too.

When you want to save system tiddlers too you should remove the
  !is[system]
part of the filter (or the filter-field of the attached tiddler after importing)

when you are developing your own system tiddlers then you are probably use a personal prefix similar to what I use:
  $:/plugins/wjam/xyz
Then add a filter which contains
  search:title[$:/plugins/wjam/]
in the filter.

I've seen the option to disable updating the modified field, but I do not use it. This would complicate versioning. Above additions will at least include all your stuff. :)

related topic: When you use my diffview import at twjam5beta.tiddlyspot.com the tiddlers with unchanged modified fields will be deselected by default and therefor not automatically imported when you press the [import] button.

It would be best to select those just to be sure using the provided single checkbox.

//It would also be possible to add additional checks e.g. compare text fields using wikify widget but that will slow things down considerably.//

wjam

TonyM

unread,
Nov 28, 2018, 7:33:15 PM11/28/18
to TiddlyWiki
Folks,

I am bringing this thread back to life because I think there is an even better approach to  Emergency tiddlers export to JSON,

The haschanged operator

<$list filter="[haschanged[]]">

</$list>

It lists all tiddlers edited, even if not changed, since the last load of tiddlywiki, in noteself this is all tiddlers since you opened the NoteSelf file the first time (needs confirmation).
Note you may have saved the wiki, but this list will not be reset, This could be good if the saves were actually failing, hence your need to an  Emergency tiddlers export to JSON,


or 

<$list filter="[!is[system]haschanged[]!has[draft.of]]">

</$list>


Regards
Tony
Reply all
Reply to author
Forward
0 new messages