* Backup and Restore Family Historian Settings

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
avatar
ColinMc
Superstar
Posts: 460
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Backup and Restore Family Historian Settings

Post by ColinMc »

Mike

You may recall that quite a few months ago I contacted you (by email) about a problem I was having with the "Backup and Restore Family Historian Settings" plugin not retaining the saved Backup destination folder.

Having had a bit of time recently, I played with the problem and I think I have partially identified the issue.

In FH Tools> Preferences, I have my Default Backup Folder specified as an external disk. (The z is simply there to force those folders to the bottom of the list.)

F:\z Family Historian Backup - Projects

Inside the Plugin, I initially defined the Backup Folder on the Options Tab as

F:\z Family Historian Backup - System

In normal circumstances, all works well.

I now throw a problem into the works. When a (Plugin) backup is completed, I re-name it by adding the time of creation as a simple space + hhss 4 digit number at the end. I then Zip the entire new backup folder so that I have a single zip file instead of approx 1700 small files.

2021-12-14_09-56-51.jpg
2021-12-14_09-56-51.jpg (68.46 KiB) Viewed 1176 times

This now enables me to run more than one distinct version of the "Backup and Restore Family Historian Settings" on the same day. A side benefit is that it also keeps my subsequent Disk based system and data backups cleaner and tidier, as only a single file needs backing up.

It seems that my renaming and/or zipping is part of the problem, but I cannot nail it down any further. The plug-in seems to want to default to the FH Backup folder in some circumstances. I initially thought it was simply a matter of not finding any folder names in the format it expects, but it seems more complex than that (and it is happy on the very first run when no folders are present at all!). But it does seem to be linked in some way to these extra steps I take.

Colin
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Backup and Restore Family Historian Settings

Post by tatewise »

Thank you for that feedback. It is almost certainly your renaming and zipping that is the problem.

The plugin saves its settings on a per Project basis.
So for consistent behaviour, you must always use the same Project, otherwise the defaults may be different.
( In hindsight, it may be better to save the settings globally, so that the current Project is irrelevant. )

You have enabled the Utilise Dated Subfolders option.
The plugin tries to default to the last dated backup folder FH Settings yyyy-mm-dd in preparation for a RESTORE.
However, if you have renamed and zipped that folder the plugin cannot find it, so it has to revert to the parent folder:
F:\z Family Historian Backup - System
Likewise, if there are no dated backup folders at all, then it will use F:\z Family Historian Backup - System.

I think the following explains the behaviour of the plugin...

BACKUP Operation
When a Backup is run and the last dated backup folder still exists, it is disregarded and the parent folder reinstated.
It is now in the same state as if the last dated backup folder is missing, i.e. using F:\z Family Historian Backup - System
If necessary, a new dated subdirectory for today is created in that parent folder and used as the Backup folder.
In other words, for Backups, it should not matter whether the root folder or old dated subfolder is the default.

RESTORE Operation
When a Restore is run and the last dated backup folder still exists then it uses that folder to restore from.
But in your case, that folder does not exist, so the Restore will fail.
You will need to unzip the folder and specify it in the Options tab to proceed.
If you forget to remove the hhmm suffix, then the plugin does not recognise it as a dated subfolder.
So that will become the root folder for all subsequent dated subfolder backups, unless you zip it up again.

Solutions
Don't rename and zip the latest dated backup, then the plugin should not get confused.
Or if you do rename and zip the folder, then before a Restore, unzip and rename back to the original state.

BTW:
I am surprised you need more than one FH Settings backup on the same day!
I would have liked the plugin to utilise a zip folder for the backups, but it was not possible. for technical reasons.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
ColinMc
Superstar
Posts: 460
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Re: Backup and Restore Family Historian Settings

Post by ColinMc »

Thanks for clarifying that. Now I know the details, I'm quite happy doing the manual alteration each time I run the plugin. So far I've never needed a Restore, but I realise I would need to unzip and rename first.
I am surprised you need more than one FH Settings backup on the same day!
My main use for this is when I'm doing edits on a Fact. Before I start I make a fresh backup, then as I develop my changes, I will make backups at several stages so I can revert if I don't like what I've done. As a non-expert, many of my changes are done on a trial and error basis, and being able to revert is a good safety net. I've never needed it but ... Once I've finished, then I delete the interim stage backups.
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Backup and Restore Family Historian Settings

Post by tatewise »

May I make a suggestion, as running the Backup and Restore FH Settings plugin and going through rename & zip seems overkill for simply preserving Fact Set edits.

Use the File > Import/Export > Export > Fact Set > Custom Fact Set... command, choose the Fact Set you are working on, and save it with a date-time stamp inserted in the filename. That must be quicker than the plugin, rename, zip method.
To restore you'll need to remove the date-time stamp from the filename and use File > Import/Export > Import > Fact Set...
Last edited by tatewise on 14 Dec 2021 15:28, edited 1 time in total.
Reason: Removed reference to Old Versions button
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
ColinMc
Superstar
Posts: 460
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Re: Backup and Restore Family Historian Settings

Post by ColinMc »

Thanks for the suggestions.

As I said before I am not fluent in the coding, and spaces, commas, full stops etc often end being done by trial and error.

However, as you suggest, Exporting a Fact Set will be simpler than backups. That File > Import/Export > option is another part of the software that I've rarely (if ever) looked at, so I do not think I'd ever been aware that I could export a fact set.

As ever your help is invaluable (and speedy). Many thanks
Last edited by tatewise on 14 Dec 2021 15:28, edited 1 time in total.
Reason: Removed reference to Old Versions button
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
User avatar
tatewise
Megastar
Posts: 28410
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Backup and Restore Family Historian Settings

Post by tatewise »

It sounds like you are mostly focusing on Sentence Templates.
Here is a technique I use when designing complex Expressions in Sentence Templates, Queries, Diagram Text Schemes, etc.

Open a plain text editor such as Windows Notepad and save it under a suitable filename on say the Desktop.
Copy the Sentence Template or other Expression into Notepad. You can put a date-time stamp against it if required.
Save the Notepad file again.
It is often easier to edit a copy of the Expression in Notepad than in the sometimes small and awkward FH edit box.
Copy the edited Expression into the FH edit box and test it. In Notepad add a date-time stamp and save again.
Repeat as necessary.
Then the Notepad file has a log of your attempts, successes, failures each with a date-time stamp until you are done.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
ColinMc
Superstar
Posts: 460
Joined: 17 Jan 2019 11:35
Family Historian: V7
Location: Edinburgh

Re: Backup and Restore Family Historian Settings

Post by ColinMc »

Certainly the bulk of my attention is on Sentence Templates, But I also have quite a few with Auto Create Notes, new (or different) Role texts etc as well. But even something as simple as trying to ensure consistency in Sentences for example what version of Place or date to use on all Facts, and ensuring that all sentences allow for <note> as well means that the bulk of edits are in the Sentence Templates.

I do always use Notepad (set to a nice large font) to edit - and I insert appropriate line breaks to split it into manageable sections - these disappear automatically when pasted back into FH! I did not think of using a dated Notepad file as a temporary backup though, that sounds like an even easier solution.

Thanks again.
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
Post Reply