Entity IDs inconsistent across exports and imports

Created on 12 February 2019, almost 6 years ago
Updated 6 January 2024, 12 months ago

Sync presupposes that when taxonomies (or other entities) are exported in production that they will actually work in the development site. This might work for sites that were initially synchronised with a mysql_dump etc. but this does not work to set up a blank development environment from scratch, where initial database ids will have a different value. After import the id numbers are not identical and therefore views with term filters will break.

I wonder now if it is at all possible to also export the id numbers? That is relevant to give sync its true meaning, that both sites work and that I don't need walk trough all my views to correct the wrong terms. Obviously this problem also exist in the opposite direction when I export my updated dev views and apply them in production. In the end I did not bother using structure_sync and I am now upgrading my views by hand. I don't think that was the original intention of this module so I present it as a task to (optionally) also include the ids in ex-/import.

📌 Task
Status

Needs work

Version

1.16

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany tomsaw Essen

    Thank you! Patch #9 does the job for me

  • Status changed to RTBC about 1 year ago
  • 🇮🇹Italy lolandese Turin, Italy

    Changing status, based on the last comments above. It seems that the majority of commenters "vote" for committing this.

  • 🇫🇷France louis-cuny

    I would be happy to merge this issue, I totally agree we need to be able to retrieve tid that are currently wrong and broking relations

    But what does happen if there is a term already existing with a tid that is going to be imported ?

    We need a clarification of what is happenning in any case

  • 🇮🇹Italy lolandese Turin, Italy

    But what does happen if there is a term already existing with a tid that is going to be imported ?

    It gets overwritten with the new data. That is exactly what you would expect when doing an operation called "Force".

  • 🇫🇷France louis-cuny

    I agree, we still need to make it more obvious about the differences between safe, full and force mode for taxonomies before we can merge this patch

    Thanks

  • Status changed to Needs work about 1 year ago
  • 🇵🇱Poland adam_y

    Not sure if a comment on Drupal 10.1 is relevant here, but I confirm that in Drupal 10.1 you can still experience an issue with inconsistency between source and destination TIDs when you expect the TIDs to be preserved from the source (what is in structure_sync.data.yml file).

    It is not entirely clear to me how to achieve that goal.

Production build 0.71.5 2024