Page 1 of 1
Problem setting up new laptop
Posted: 25 Mar 2022 22:09
by rob p
I bought a new laptop and installed my 'other' license of FH7 (7.0.11.0) on it.
I followed the kb-article/family-historian-copy-and-migration-guide strictly.
I copied my projects and data OK, but can't get my settings and customizations. I ran the backup-and-restore plugin, also per instruction. But I get the following error message:
LUA ERROR
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:4799: attempt to compare nil with number
stack traceback:
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:4799: in upvalue 'getTime'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:4815: in upvalue 'intTime'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:5967: in function <[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:5898>
(...tail calls...)
[C]: in function 'iuplua.MainLoop'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]

in field 'ShowDialogue'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:6257: in function 'GUI_MainDialogue'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:6297: in main chunk
There is no going forward. Clicking "Continue" does nothing, the plugin can't be terminated, the computer is completely non-responsive; the only way out is Windows Task Manager>End Task. I tried three times, even went back to the source PC and re-created the backup; same.
(Source PC-Windows.10, Target Laptop-Windows.11, both up-to-date; both FH7.0.11.0)
Whassup? Any help?
Re: Problem setting up new laptop
Posted: 25 Mar 2022 23:08
by Mark1834
The error message refers to line numbers in the plugin script, so detailed examination will probably have to wait until Mike comes back on line tomorrow. Technically, you are restoring to a different version of Windows (from 10 onto 11), but all the plugin does is backup and restore two folders and two Registry keys, and I'm not aware of any differences in these between the two Windows versions (which are very similar in their internal plumbing).
Re: Problem setting up new laptop
Posted: 26 Mar 2022 10:39
by tatewise
Sorry about that error rob.
It is rather odd because it is caused by a file that has an unusual Modified Date.
To investigate further please download and run the attached Backup and Restore Family Historian Settings plugin Version 3.2.1 Date 26 Mar 2022.
When it encounters the problem it should report the Modified Date and the full file path. Click OK to continue.
Let me know what it says so that a workaround can be devised.
If more than one such error is reported then click the Cancel button to abort, then click Continue, and finally use the X Close icon top right of the plugin window.
Re: Problem setting up new laptop
Posted: 27 Mar 2022 15:39
by rob p
I first ran the revised plugin (Restore) using the 'same' backup file, and got essentially the same result.
Several 'new' pop-up's showed, each with detail reporting the 'problem date' and the full file path. Example:

I clicked
OK through 2 or 3 of these, and then clicked
Cancel to abort. At that point, a similar "LUA ERROR" dialog appeared:
LUA ERROR
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:4818: DateLastModified is abnormal
stack traceback:
[C]: in function 'error'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:4818: in upvalue 'intTime'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:5488: in local 'doBatchJob'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:5536: in upvalue 'doImportRegistry'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:6016: in function <[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:5904>
(...tail calls...)
[C]: in function 'iuplua.MainLoop'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]

in field 'ShowDialogue'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:6263: in function 'GUI_MainDialogue'
[string "C:\ProgramData\Calico Pie\Family Historian\Pl..."]:6303: in main chunk
, and once again everything was locked up. ...Task Manager>End Task.
I then went back to the Source PC, and tried to re-create a
new backup file with the revised plugin. This time, I got a whole new series of warnings - similar to those of the Restore effort - followed by a similar LUA ERROR dialog. Here, however, I was able to abort and close without Task Manager. It created an empty "Family Historian" (backup) folder. (I had saved the previous backup elsewhere.)
I'm really confused now.
Re: Problem setting up new laptop
Posted: 27 Mar 2022 16:50
by rob p
Clue?
Out of curiosity, I looked at the various file dates that seem to be of issue. For example, the one shown in my screenshot, ...\Application\Preferences\prefs.dat; the reported 'abnormal' "Date Modified 3/11/22 6:00:14 PM" is actually "...3/11/22 5:00 PM". There is exactly one hour difference in the dates I looked at.
Might this be related to our crazy stupid Daylight Saving Time? The time switch was after 11 Mar. The PC changed automatically to DST; I got the Laptop after. Both computers show the same time right now. Do Windows 10 & 11 handle this differently?
I'm still confused.
I consider my desktop PC as the primary source for my FH projects. I will use the laptop for research trips, and for "show-and-tell" with friends and family. I intended to use Backup and Restore to manually sync them whenever changes are made. I want this to work.
Re: Problem setting up new laptop
Posted: 27 Mar 2022 19:05
by tatewise
Thank you for the feedback Rob. The screenshot of the error message has given me everything I need.
In all my tests so far, the day of the month, and the hour of the day, have always been 2 digits.
But your screenshot shows the leading zeroes have been suppressed:
3/11/2022 6:00:14 whereas the plugin is expecting 03/11/2022 06:00:14
I have found the Settings for 'Change data formats' that customises 'Short date' and 'Long time' and will cater for all the options in the next published version of the plugin.
The attached Backup and Restore Family Historian Settings plugin Version 3.2.2 Date 27 Mar 2022 should fix the problem for your formats.
Re: Problem setting up new laptop
Posted: 27 Mar 2022 20:28
by rob p
New problem...
Installed and ran v.3.2.2.
...After the Close Program> OK-Quit Plugin, the next expected dialog (Do you want to continue and import Registry Data Keys [Y/N] ?) appears in a Windows Command Prompt pane. I tried to answer there, and everything closes.
Re: Problem setting up new laptop
Posted: 27 Mar 2022 20:51
by tatewise
The final step of restoring the Registry Keys data is quite unusual.
After clicking OK - Quit Plugin the plugin closes.
Then it is crucial that you close FH itself, leaving just the Command Prompt window.
Enter Y and press Enter to complete the Registry Keys restoration.
The Command Prompt window closes and when you reopen FH all the Windows Registry settings should be restored.
Re: Problem setting up new laptop
Posted: 27 Mar 2022 21:41
by rob p
Yes!

All is well.
I’m sorry if I sent you chasing rabbits. But whatever you did to accommodate my (preferred) date format will be good. Thank you for your work and for your patience!
Re: Problem setting up new laptop
Posted: 28 Mar 2022 14:01
by tatewise
Backup and Restore Family Historian Settings plugin Version 3.3 Date 28 Mar 2022 is now in the Plugin Store.
That caters for all the date-time formats set by 'Change data formats' in the 'Short date' and 'Long time' options in Win 10.
P.S.
I've run some further tests and a few date-time formats are still not handled correctly.
It also relies on 'English' formats, so need to investigate if foreign language formats are different.
Does anyone have any tips for converting file modified date-time to Unix timestamp seconds since 1-Jan-1970 in a plugin?
See end of thread
Restoring Settings to New OS Build (20497).