Skip to content

Conversation

@DennisGarding
Copy link
Contributor

@DennisGarding DennisGarding commented Sep 24, 2025

closes: #12365

Implement apply migration fix before write the converted data to DB

Answered Questions:

  1. Get it implemented in an actual data migration, e.g. you mentioned the AbstractWriter as a place to put this new logic, try to get it working there

Works now: see src/Migration/Service/MigrationDataWriter.php line 106 - 107

  1. Intentionally break some data in your source system (e.g. remove the email of one customer in SW5). Then migrate them to SW6. You should find a log entry about it and the customer shouldn't be migrated. Then manually add a fix to swag_migration_fixes and migrate again. Is the customer then migrated properly?

Works fine and the customer is migrated.

  1. After 2. fix the SW5 customer in the source system (assign him a different email than used in the fix). Then migrate again. Takes the new source data or the old fix priority?

Currently, there is no functionality to prioritize the source data. The fix is always applied. There is a Ticket to implement this! See Ticket: shopware/shopware#11819

@DennisGarding DennisGarding self-assigned this Sep 24, 2025
@larskemper larskemper changed the title 12365/apply fixes prototype feat: apply fixes prototype Sep 24, 2025
@jozsefdamokos
Copy link
Member

@DennisGarding I dont really understand how this should work. Can you give an example of how this would be called?

@DennisGarding
Copy link
Contributor Author

DennisGarding commented Oct 6, 2025

@jozsefdamokos

We can apply the fixes before we write. Just an example. We need to figure out the best position for this, because we need the connectionId

image

Copy link
Contributor

@MalteJanz MalteJanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open questions from my side that I think this prototype should answer:

  1. Get it implemented in an actual data migration, e.g. you mentioned the AbstractWriter as a place to put this new logic, try to get it working there
  2. Intentionally break some data in your source system (e.g. remove the email of one customer in SW5). Then migrate them to SW6. You should find a log entry about it and the customer shouldn't be migrated. Then manually add a fix to swag_migration_fixes and migrate again. Is the customer then migrated properly?
  3. After 2. fix the SW5 customer in the source system (assign him a different email than used in the fix). Then migrate again. Takes the new source data or the old fix priority?

@MalteJanz
Copy link
Contributor

would be great if you could add a proper PR description that documents your insights and decisions from this prototype and also answers these questions 🙂 :
#63 (review)

Copy link
Contributor

@MalteJanz MalteJanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the prototype, nice job 👍

Copy link
Member

@vintagesucks vintagesucks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DennisGarding DennisGarding merged commit 35709d7 into feature/migration-logging-refactor Oct 31, 2025
7 checks passed
@DennisGarding DennisGarding deleted the 12365/apply-fixes-prototype branch October 31, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants