* Timestamp error in Backup and Restore Family Historian Settings Plugin

Writing and using plugins for Version 5 and above.
Post Reply
avatar
Mark1834
Megastar
Posts: 1450
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by Mark1834 » 24 Apr 2022 22:08

I was benchmarking the new Windows Backup and Restore FH Settings plugin against Version 3.2 of the existing plugin, and noticed an odd error in the backup timestamp. It appears to be exactly two hours ahead of when the backup was actually taken.
Capture.PNG
Capture.PNG (26.57 KiB) Viewed 854 times
Compare with the actual files below:
Capture1.PNG
Capture1.PNG (8.72 KiB) Viewed 854 times
I don't recall seeing this reported before. Is it a known issue...?
Mark Draper

User avatar
tatewise
Megastar
Posts: 24392
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by tatewise » 25 Apr 2022 10:00

Version 3.2 pre-dates all the locale timestamp fixes that are now in the latest Version 3.4 in the Plugin Store.

Does plugin Version 3.4 resolve the discrepancy?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Mark1834
Megastar
Posts: 1450
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by Mark1834 » 25 Apr 2022 18:30

Curious - version 3.4 fixes the incorrect timestamp, but raises another issue. I didn't check the store, as version 3.2 insists that it is the latest version when I run it!
Capture.PNG
Capture.PNG (20.84 KiB) Viewed 767 times
I tried Jane's Check Installed Plugins Against the Store, and that got it right. It quickly identified that the plugin was out of date and seamlessly updated it.

I've opened the plugin a number of times over the past couple of weeks, and it has never told me to update. Presumably the periodic check hasn't run, but not sure that "haven't checked" should be reported as "up to date"...

On a slightly different topic, the only reason I was running the existing plugin was to benchmark against the draft Windows version. The comparative write times are interesting, and clearly show the huge overhead of managing the copying with Lua rather than natively in Windows, particularly as it seems to create a complete new backup each time it is run, rather than just updating changed files.
Capture1.PNG
Capture1.PNG (6.53 KiB) Viewed 767 times
It's particularly an issue for the slower NAS and USB backups, as it ties up FH all the time that it is running. With the Windows version, the copying runs in a separate process. Once it has started, the user is free to close the plugin and even close FH if they want to.
Mark Draper

User avatar
tatewise
Megastar
Posts: 24392
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by tatewise » 26 Apr 2022 09:44

Apologies regarding the latest version identification. In response to user requests to reduce the run-time overhead, I've been modifying plugins to only check the version in store once per month. Unfortunately, there is a flaw in the routine such that in this plugin its initial message now only mentions a later version once a month and can easily be overlooked. :oops:
That will be fixed in the next version.

Regarding run-time, the plugin is only copying files that need to be copied (assuming the same folder is used as before).
However, the Lua time needed to extract and compare the size and modified date-time of each pair of files is significant.
So the time saved by avoiding the file copying is probably relatively small.
In addition, the plugin performs a reverse 'discrepancy' check comparing each backup file with the program settings files to report files in the backup that no longer exist in the program settings.
When any backup file is dated later than its counterpart or the counterpart does not exist then the user is offered options.

Clearly, the Windows-based backup/restore is faster. No surprise there.
I would love to retire my plugin but that would leave some scenarios unsupported.
e.g. 1) Windows emulators (Crossover/Wine), 2) Beta test FH installed versions
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 3687
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by ColeValleyGirl » 26 Apr 2022 09:53

tatewise wrote:
26 Apr 2022 09:44
Clearly, the Windows-based backup/restore is faster. No surprise there.
I would love to retire my plugin but that would leave some scenarios unsupported.
e.g. 1) Windows emulators (Crossover/Wine), 2) Beta test FH installed versions
I'm pretty sure a version of Marks' plugin could be quickly pulled together for Beta testing in future...

User avatar
tatewise
Megastar
Posts: 24392
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by tatewise » 26 Apr 2022 09:58

But would it allow Beta backups to be restored into the subsequent full release as some users requested?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Valkrider
Megastar
Posts: 1442
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by Valkrider » 26 Apr 2022 13:06

tatewise wrote:
26 Apr 2022 09:44
I would love to retire my plugin but that would leave some scenarios unsupported.
e.g. 1) Windows emulators (Crossover/Wine), 2) Beta test FH installed versions
This may be an issue for a couple of scenarios:

1: User swaps from PC to Mac or Mac to PC
2: User who has both Mac and PC and takes advantage of the two non-concurrent sessions and uses both machines to run FH.

I fit in to scenario 2 and would hate to lose Mike's plugin, however, I appreciate that PC emulator users are in the minority and so if it makes sense to retire it then so be it.

avatar
Mark1834
Megastar
Posts: 1450
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by Mark1834 » 26 Apr 2022 14:26

I think we need to get away from the idea that backing up FH settings is some kind of black art that needs a complicated plugin to accomplish.

In a PC environment, it’s no more complex than copying two folders and extracting two Registry keys. Any user could do it for themselves at any time. All the plugin does is provide a bit of hand-holding for those who don’t have the confidence or experience to do it for themselves. For me, the less it interferes with the actual copying process, the better.

As such, copying beta settings to the released app is merely a change of folder name, and maybe a minor edit of the Registry key files. Again, any user could do that manually now, but building it into the plugin if there is ever an FH8 would be trivial.

I must admit, I’m much less familiar with how this works under emulators, but I’d be surprised if the same principles didn’t apply - the plugin is just hand-holding, rather than enabling something that couldn’t be achieved without it.
Mark Draper

User avatar
tatewise
Megastar
Posts: 24392
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by tatewise » 26 Apr 2022 14:52

As I mentioned elsewhere, the problem with emulators (last time I checked) is they do not support Reg Export/Import.
So the script must perform a Reg Read/Write operation for each separate Registry key.
The set of Registry keys is derived from Reg Export operations run on a native Windows PC and built into the script.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Mark1834
Megastar
Posts: 1450
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by Mark1834 » 26 Apr 2022 15:34

I’m intending to have a play with FH6/Linux sometime, but I don’t know if Mac emulators would behave in the same way. From what I’ve seen, changes in software versions seem to cause a lot of issues, and I must admit, I’m not sufficiently interested in Macs to delve into the details.

If you do decide to retire your plugin at some stage, it would be an easy addition to the Windows version to restore its backups. We get there in very different ways, but the outputs of the two plugins are virtually the same, so all I would have to do is look in slightly different places for the components.
Mark Draper

User avatar
tatewise
Megastar
Posts: 24392
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by tatewise » 26 Apr 2022 16:54

Mark, the emulators are essentially the same for Linux and Mac, all being based on WineHQ.
( See the KB Running Family Historian on Wine/Crossover/PlayOnLinux/Mac )

Yes, I guess a Windows Registry backup could be used to restore on Linux or Mac, but the reverse would be a challenge.
Also, most Linux or Mac users don't have a Windows version to refer to, so they would be snookered.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
mjashby
Megastar
Posts: 664
Joined: 23 Oct 2004 10:45
Family Historian: V7
Location: Yorkshire

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by mjashby » 26 Apr 2022 17:04

FWIW it is possible to import/export Registry Files in WineApps (including Crossover etc.), but this should be carried out using the Wine implementation of 'regedit'. WineHQ Guidance warns strongly against attempting to edit the Wine implementation of the Registry by any other method.

That said, from my tests on both Linux (native Wine installation) and MacOS (Crossover), the established Backup & Restore plugin does successfully apply/import registry keys exported from a Windows System. I doubt that this could be achieved directly using a Windows Batch (.bat) file as I can find no way to run a .bat script within a Wine App, apart from line by passing it line to command.exe; or possibly by converting the <windows>.bat file to an .exe

If someone is running entirely on MacOS/Linux then, as mentioned previously, IMO there is little point in using any plugin for settings transfer. Simply Backup (Export) the WineApp instead, before and after making any significant update or settings change.

Mervyn

avatar
Mark1834
Megastar
Posts: 1450
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by Mark1834 » 26 Apr 2022 17:26

This sounds like an important point - Mike seems to be assuming that most Unix-like users don't also have a Windows version of FH (and that makes sense to me - if you have access to both ecosystems, surely you would run FH where it belongs, in Windows). But Mervyn seems to be saying that type of user doesn't need the plugin solution anyway, as there are better ways of doing it.

To me, that suggests that Mac/Linux support is a bit of a red herring, and we don't actually need it for real world application...?
Mark Draper

User avatar
tatewise
Megastar
Posts: 24392
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by tatewise » 26 Apr 2022 19:08

I would be more than happy if there were another solution and thus be able to retire my plugin.
Part of my problem is that I don't have the capability to run Unix or Mac systems and rely on feedback from others.

FYI: As Mervyn suspected, my plugin does not use standard Windows .bat scripts in Wine based emulators, but instead uses CSCRIPT to run a VBS command file.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Valkrider
Megastar
Posts: 1442
Joined: 04 Jun 2012 19:03
Family Historian: V7
Location: Lincolnshire
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by Valkrider » 27 Apr 2022 06:24

Mark1834 wrote:
26 Apr 2022 17:26
To me, that suggests that Mac/Linux support is a bit of a red herring, and we don't actually need it for real world application...?
Definitely not a Red Herring @Mark I run FH on my MacBook Air, which has limited storage and processor power, using Crossover as it will not run a VM at a sensible performance. This is what I take when I am researching away from home. On my desktop computer an iMac I use a VM with Windows 10. I realise that I am probably one of a very small number of users who work this way BUT we do exist.

User avatar
tatewise
Megastar
Posts: 24392
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by tatewise » 27 Apr 2022 09:14

Ideally, the non-plugin scripts created by the new Backup and Restore FH Settings plugin (or other methods) should utilise identical folder, file & data structures so they are compatible with both Windows and the Linux/Mac emulators.
That should be perfectly feasible as the data is identical in all those systems.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Mark1834
Megastar
Posts: 1450
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Timestamp error in Backup and Restore Family Historian Settings Plugin

Post by Mark1834 » 27 Apr 2022 16:24

My plan is to fine-tune the new plugin and its help file to reflect recent discussion and requests arising from version 0.4, and submit it to the Store with that scope (i.e. 64-bit Windows 7 SP1 or later), as that is probably >95% of the user market.

Only then will I play with extending the scope. If there is to be an emulator-compatible version, I think it will need to be tested in a range of different environments (e.g. current MacOS, Debian and non-Debian Linux, Wine vs CrossOver) rather than be optimised for just one. I can test Linux/Wine, but not much else.

I'll start a new thread when there is anything significant to report, as we are drifting away from the original topic somewhat here.
Mark Draper

Post Reply