# Import new records (gramps xml) starting after last/highest existing ID?

**URL:** <https://gramps.discourse.group/t/import-new-records-gramps-xml-starting-after-last-highest-existing-id/5026>\
**Category:** Help\
**Created:** [March 2, 2024, 11:56am UTC](https://gramps.discourse.group/t/import-new-records-gramps-xml-starting-after-last-highest-existing-id/5026 "2024-03-02T11:56:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jens](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/jens/32/2557_2.png) [@Jens](https://gramps.discourse.group/u/Jens)\
**Post date:** [March 2, 2024, 11:56am UTC](https://gramps.discourse.group/t/import-new-records-gramps-xml-starting-after-last-highest-existing-id/5026/1 "2024-03-02T11:56:54Z")

</div>

Gramps 5.1.5 on Ubuntu

When doing an import (Gramps XML) I would like the newly created Records to have an ID starting _after_ the highest already existing ID in the existing family tree.

Because I often sort via IDs column (instead of “Last change”). This also makes an overview easier, when looking at the data **later** because all imported records will be near to each other. And then cleaning up is easier.

However, I have gaps in my already existing Records because I deleted some erroneous records from time to time.

_ **Example:** _

I have about 30 Notes – and last Note is ID N0040 (so like 10 “gaps”). So I do not have N0001 for example. Now the import data has a record with N0001.

**What I want:**

Now all imported data should be imported starting with ID N0041. This happens in most cases.

**What happens instead:**  
But for the gap, the one note for instance is imported “out of order” into N0001. So – ID wise – the imported data is “torn apart” and mixed up with the rest of the existing data

---

<div class="post-metadata">

**Author:** ![Jens](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/jens/32/2557_2.png) [@Jens](https://gramps.discourse.group/u/Jens)\
**Post date:** [March 3, 2024, 6:36am UTC](https://gramps.discourse.group/t/import-new-records-gramps-xml-starting-after-last-highest-existing-id/5026/2 "2024-03-03T06:36:38Z")

</div>

I was able to solve my problem by **first** closing the gaps in the existings records’s ID ranges using the [Reorder Gramps IDs](https://gramps-project.org/wiki/index.php/Gramps_5.1_Wiki_Manual_-_Tools#Reorder_Gramps_ID) tool:

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/1/1319a3f304438cd43946de8bc4480d3375394df0.png)

After having done this I did the import and the newly imported records are now **after** the existing one and all together.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [April 2, 2024, 6:37am UTC](https://gramps.discourse.group/t/import-new-records-gramps-xml-starting-after-last-highest-existing-id/5026/3 "2024-04-02T06:37:22Z")

</div>

Closed on April 2, 2024, 6:37am UTC

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