Why built-in import does not uses current id values?

We are using the build-in export function to create a tar file. Later we untar it and store it in a git repository. However after each import, the id values are autoincremented, and when the same data exported again, id values in jsonl files in configuration, entities and links folders are all updated, and git assumes the whole file changed rather than the actual changes.
I checked the strapi source code and by modifying 3 lines I’m able to import records by retaining ids. Now I’m trying to understand the rationale behind the decision of not using id values during import process.

This topic has been created from a Discord post (1238150940067102853) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

I’m not a maintainer or decision maker at Strapi. This is not information coming from a Strapi expert.

But, in my opinion, this makes sense. If you’re importing data into a database you wouldn’t want it to overwrite previously used ids. In your case it makes sense to retain ids, but I don’t think that the general populous would benefit from imports retaining ids. Maybe I’m misunderstanding what you’re saying, though.

I thought this also. However import already deletes all data in all collections. Therefore no records will be overwritten with the same id. By the way, my solution fails. I’m able to retain the ids in the collection. However I’m not able to retrain ids of the components. Entity service creates a new record with new id, even if the id’s of the component is set during import.

that’s the way it’s you need to truncate tables yourself, but then id’s only would start from beginning, i’m using pg_dump pg_restore

thne you have mirrored db