Import from TMG

Potential new user here. I have GRAMPS 5.1.5 running on LinuxMint 21.2 with Windows XP running in a virtual machine for my older genealogy software.
I am currently using an old version of TMG(The Master Genealogist). I would like to try switching to GRAMPS. A number of years ago a program was written in Perl to extract the information from a TMG database and put it into an XML file that GRAMPS could import. Having found this program I have done this conversion but for me there are several inadequecies with the way it is done. Specifically I have a great number of people in my databases that have nick names or who are ‘called’ by their second name. The GRAMPS ‘person window’ of course has fields for nick name and called name. The conversion presents this info to GRAMPS and after importing it can be found by digging down for it but the fields do not get populated. Another thing is that in TMG a person’s info is marked ‘private’ by putting a - in front of their given name. This does not get converted from TMG to Gramps.

OK so I created a small fake GRAMPS family tree with people having nick names and called names and with the privacy lock applied. Then I exported it to an XML file so that I could see the syntax used. Then I wrote a program in Python to correct the TMG conversion XML file to have the correct syntax. In order to be able to test this quickly I created a small family in TMG, about 20 people, with a variety of nick names and called names and titles such as Dr. and suffixes like Jr. and marriages and divorces etc.
If I convert that database and then run my program to ‘fix’ the XML file I get a new XML file that GRAMPS can import with no problem. People who should be private are ‘locked’. People with nick or called names or even both have the appropriate fields populated.

My mother’s family database(about 4700 people) and my father’s family database(about 18,000 people) converted to XML files will import into GRAMPS. However if I run my ‘fix’ program on them GRAMPS will get most of the way through the import and then throws a error. I have tried adding a simple print statement to the GRAMPS import program(importxml.py) to see what kind of response I would get and if I could get more info on what exactly is causing the error. However this causes GRAMPS to cease to recognize that .gramps is a valid file format. I have no idea how adding one line to the program can do that and I am not sure how to proceed further.

Here is the error sequence that GRAMPS is reporting.

77774: ERROR: dbloader.py: line 569: Failed to import database.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/dbloader.py", line 555, in do_import
    self.import_info = importer(self.dbstate.db, filename,
  File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 149, in importData
    info = parser.parse(xml_file, line_cnt, person_cnt)
  File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 936, in parse
    self.p.ParseFile(ifile)
  File "../Modules/pyexpat.c", line 416, in StartElement
  File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 3139, in startElement
    f(attrs)
  File "/usr/lib/python3/dist-packages/gramps/plugins/importer/importxml.py", line 1769, in start_last
    self.name.group_as = attrs.get('group', '')
AttributeError: 'NoneType' object has no attribute 'group_as'

I don’t have any real answers for you, but my heart goes out to you and I sympathize with your position.

I began my genealogical journey decades ago using TMG and had to put everything on hold for awhile after I migrated to Linux from Windows. For a sometime, I was using TMG in a Windows virtual machine on my Linux system, and then eventually discovered GRAMPS. The process of migrating my data to GRAMPS was a painful learning experience, but eventually I got it done and have been a very happy GRAMPS user ever since.

I did that over a decade ago, and used tmg2gramps which I suspect is the Perl program you reference. I detailed everything I learned from my experience (and tried to provide a guide that might be helpful to others) in this long and admittedly convoluted entry in the GRAMPS wiki:
https://gramps-project.org/wiki/index.php/Import_from_another_genealogy_program#The_Master_Genealogist_.28TMG.29

As I recall, I found that many (if not most) of the issues I encountered could be corrected by directly editing the GRAMPS XML file of my data.

Wishing you all the best.

1 Like

I have a commercial program called “TMG to GEDCOM” (T2G) that exports TMG project data to a GEDCOM 5.5.1 file. It has a template for GRAMPS that configures the T2G options for use with GRAMPS.

You wrote you are “using an old version of TMG”. T2G only works with TMG projects written by TMG v9.05, the last released version of TMG. If you are using an earlier/older version of TMG, then T2G won’t help. You could update to TMG v9.05, but if you’d have to purchase a license for TMG v9 if you don’t have one.

You can read about T2G here: https://www.tmgtogedcom.com

1 Like

It appears that you have created Gramps XML file that is no valid. Try validating your XML against our XML schema.

Check that your “group” entries are contained within “name” elements.

Thanks for all of your replies. Yes I am using the tmg2gramps program. Gedcom is not an option as my TMG version is I believe 6.

I am not sure what you mean by “group” entries. I looked at the XML schema and can see the word group in a couple of places. However the word group does not appear in the working XML file that once I ‘fix’ it will not import. My ‘fix’ program only touches the section of the xml file.

I was just looking at the error message that you posted. It’s difficult to say what the problem is without seeing your xml. Does it validate?

Sorry I didn’t understand at first that there was a program to run against my original and my ‘fixed’ gramps files to validate them. <i have now tried that and the ‘fixed’ file is popping up a couple of errors so now I have something to track and fix. Thx.

1 Like

Long ago before I really knew what I was doing I apparently entered tons of names incorrectly in TMG. Thanks to the validation program I have found all the errors in my Mother’s family database. My ‘fixed’ file for that database is now OK. I am now working on my father’s family but that is going to take considerably longer.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.