Strapi database migration V3 => V4 SQL, problem with localization

V3 project node 14
V4 project node 18
databse: posgresql
OS: windows

Hello, i have problem with database migration from strapi V3 to strapi V4. It seems that my localised data is not migrated with the SQL migration script, some do, and some dont… I have tried to search across whole google, but couldnt like find the answer to this issue. It all started with the error:

error: insert into "public"."products" ("abstract", "created_at", "created_by_id", "id", "locale", "name", "published_at", "sort_date", "updated_at", "update
d_by_id", "url") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11), ($12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22), ($23, $24, $25, $26, $27, $2
8, $29, $30, $31, $32, $33), ($34, $35, $36, $37, $38, $39, $40, $41, $42, $43, $44), ($45, $46, $47, $48, $49, $50, $51, $52, $53, $54, $55), ($56, $57, $58
, $59, $60, $61, $62, $63, $64, $65, $66), ($67, $68, $69, $70, $71, $72, $73, $74, $75, $76, $77), ($78, $79, $80, $81, $82, $83, $84, $85, $86, $87, $88), 
($89, $90, $91, $92, $93, $94, $95, $96, $97, $98, $99), ($100, $101, $102, $103, $104, $105, $106, $107, $108, $109, $110), ($111, $112, $113, $114, $115, $
116, $117, $118, $119, $120, $121) - duplicate key value violates unique constraint "products_url_unique"
    at Parser.parseErrorMessage (C:\Users\bednarikm\Desktop\migration-scripts\v3-sql-v4-sql\node_modules\pg-protocol\dist\parser.js:287:98)
    at Parser.handlePacket (C:\Users\bednarikm\Desktop\migration-scripts\v3-sql-v4-sql\node_modules\pg-protocol\dist\parser.js:126:29)
    at Parser.parse (C:\Users\bednarikm\Desktop\migration-scripts\v3-sql-v4-sql\node_modules\pg-protocol\dist\parser.js:39:38)
    at Socket.<anonymous> (C:\Users\bednarikm\Desktop\migration-scripts\v3-sql-v4-sql\node_modules\pg-protocol\dist\index.js:11:42)

the migration script is throwing errors due different constraints in V3 in comparison to V4 database, In V3 there is iscase_studies_url_per_locale constraint for example and in V4 shallow database created by migrated V4 strapi its case_studies_url_unique. I manualy prefixed the urls with en/ but it worked only for some tables. And i feel deeply inside that its not probably the “correct” way and its not even working at all, rather randomly :D. So i am asking how to properly set the i18n option for the database migration.

In v3 it looks like it can disinguishe same url for different localisations [cs, en], but in V4 not and needs unique urls. And having url “en/en/products” is bad idea aswell even if it would work which doesnt now. So there must be issue that I as FE developer just dont see.

In case_studies content type i have now in database en/… for en localisation but UI dont see it, see it only when i change the url to en-… because i get error for the slash “/” but in products content type i can have the “/” and it throws no errors… really I dont understand this behaviour.

And another point, when i switch the individual data rows from cs to en than for en i dont have any data, but when i switch in the upper right corner like localisation for all data to en, suddenly it shows the en rows which aswell dont have like the cs version for it …

there is probably problem in the _localizations_links tables, its not linked properly for the case_studies table and its data rows

Thanks in advance,
Morty

Forgot to give more detailed project description, sry.

  • Node.js version: v18.17.0
  • NPM version: 9.6.7
  • Strapi version: v4.20.2
  • Database: postgresql both (16)
  • Operating system: Windows
  • Project: Javascript

Maybe related to How to link content and its localized version in strapi? - Stack Overflow