Using reference numbers from TMG

I am converting from TMG. In TMG, I used reference numbers as a means of tracking my data; all exhibits, documents and data are referenced with the reference number. For example, my number is 20, therefore all files and data relating to me begin with 20, an all new entries are assigned the next available Ref#.

Since RM8 does not use reference numbers in this way, what is the consensus method of doing this?


I was never a TMG user but became acquainted with it some 8 or so years ago when its developer closed the curtain on further development and support and a number of users migrated to RM (6?), especially after RM Inc rushed out a direct import function. I participated in the TMG Refugees forum and assisted several users. In the process, I developed and published some procedures which may be of some interest, if not use, to you:

RM creates a fact (or “tag” in TMG terms) on import with the TMG ID number.
RM has PersonID (or RIN in RM terms) and some of my TMG ID numbers were kept and used as rin numbers on import. But after a thousand or so, there was a big gap introduced and the numbers no longer coincided.
Rin numbers in RM aren’t used as much as TMG id numbers because the rin is used directly as a database row id and is not usually preserved on gedcom transfers etc. TMG kept the TMG ID number even when the row id changed .
RM has a GUUD id associated with each person, but it is not documented.
No other row numbers are accessible from the user interface. I.e. source ID etc

Thanks for this Tom.
I’m a TMG convert to RM and I still miss a lot of the features of TMG.
I could see it would have been a massive job to convert TMG to a full windows app and wish someone had taken it on.

My understanding is that the dev, Velke, decided it better to put TMG to rest than to have someone try to carry it on. I know there was a project that was intended to develop a TMG-like version using the Java program language, but I don’t know what ever became of it. I think it was called HRE or something like that.

HRE does not appear to have progressed beyond initial functionality and UI specs in the five years or so since it was launched.

Tom. Thanks for the info, although I am now thoroughly confused.

I get that TMG REFN would be incremented by 1 for way person added, so the number is would unique for that person.

I’m confused by: 1-how that would work in RM8; 2-how your routine works; and 3-how to run it.

Just consider me confused by everything.

HRE exists and is still in development. But it’s not a pure Genealogical database. I get emails from them occasionally.

Hello, I’m back again with my question about reference numbers when converting from TMG, still confused as ever.

Let me ask this: Is it possible to mimic TMGs assigning of unique numbers to individuals in RM?

If not, how do others handle this?

Maybe the Reference Number fact is what you are looking for.

Did you browse the resources I linked for you a month ago. I think this one is relevant to your question:
The script needs minor revision to run on RM8/9 databases.

It presupposes that the import brought over the TMG_ID number into the custom TMG_ID fact and translates its value into a Reference Number fact for every imported person. It further shuffles any prior Reference Number facts for each person as it is the lowest row number in the EventTable whose Reference Number is displayed after the Person’s name.

I looked at it and did not fully understand. It just moves the TMG number into the RM reference number filed, correct?

I’ve never run a sqlite script before. How does one do it and what changes must be made for RM9.
Am I correct is thinking that after running this script, new records will have the Ref # incremented by 1 for each new person added?

[quote=“RobertL, post:12, topic:6205”]row number
Am I correct is thinking that after running this script, new records will have the Ref # incremented by 1 for each new person added?

No, a Ref # is arbitrary characters… it the RIN (Record Identification Number) that increments with each added individual (ie. similar to a row number down within a column or columns). And the RIN may become an empty row if the person & data is deleted.

Sorry for being dense, but I think I can see daylight. Let’s see If I get this right.

The RIN # is the RM equivalent to TMGs Ref#, correct?
The script basically moves (copies) the TMG Ref to RM RIN, correct?
This results in the REF# and the RINbeing the same the same, correct?
I can then add new people to RM and the RIN number will start from where the REF ends, correct?

Is the RIN number the field that cannot be seen in RM?

I have all my exhibits linked to the proper people via TMG Ref# and I’d hate to think I could no longer do that.

Settings->General Settings->Number to display

RIN - Every time a person is added to RootsMagic they get an ascending record number. It’s a pointer number to their record of data and incremented by one upon addition(s) of each new person(s) (unless there are previous deletions that make available previously used pointer numbers then they may or may not immediately be reused).

REFN (Ref #) - You assign a means of reference for your own use in correlating records of peoples data. Can be any combination of characters (category names/dewey decimal system/surnames&numbers/other languages/any system devised by you to categorize and refernce your data.

FSID - FamilySearch ID number assigned to recorded people on their genealogy website.

The answers are:

Probably but I don’t use TMG to verify it, and No! When you import a TMG database, each person will be assigned an RIN as they are added. This may or may not be the same as what TMG assigned. Depending how those RIN get assigned on the import, the RIN for newly added people may or may not continue from where your TMG program left off.

Tom’s script will preserve the TMG numbers in RM’s reference number fact (which is NOT the RIN). This way it preserves what you have accomplished so far with your filing system. You can either switch to filing via RM’s RIN number which will be created automatically OR you can manually continue the numbering in the REF number fact. Either way, your filing system is going to have to change.

1 Like


Thanks. You have clarified things for me and I now understand.
now about Tom’s script. I downloaded “” but I have absolutely no idea how to run the script, which I know is a separate file.

Are there instructions anywhere?

You could start here.
Are you on a Mac? That surprises me if you’re coming from TMG.

In any case, I would advise getting a sqlite manager application rather than starting with the Command Line version in that download. It’s just easier.

I’m on Windows and my goto is SQLiteSpy, n/a for MacOS, for which I might suggest SQLite Studio.

That said, if you are not computer adept, perhaps it would be wise to get someone to process your database for you. It’s a one-shot operation after which, if you choose, you could continue a pattern of adding a Reference Number fact to every new person following whatever ongoing coding system makes sense to you to correlate with your filing system.


I was (am) running TMG on my mac via Parallels. I am slowly weaning my self off of windows, of which TMG is my last program. Trying to simplify and cut costs.

Thanks for the advice, I will look at sqlite studio and see what’s what. I am computer adept but am still being cautious.

One question I encountered when looking at the instructions for sqlite was linking your script so that it could run. Maybe the studio version will solve that, but for now…




I installed sqlstudio, connected to my test DB, imported and ran your script. Here is a screenshot of the results.

Question: What steps did I do wrong, or omit?

NB: Am I supposed to also connect to my TMG DB (DUH)?