Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7 to v10 DTGE Not Migrating #168

Open
Attackmonkey opened this issue Jul 18, 2023 · 7 comments
Open

v7 to v10 DTGE Not Migrating #168

Attackmonkey opened this issue Jul 18, 2023 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@Attackmonkey
Copy link

I've exported uSync data from a V7 site, and as far as I can tell, everything is there in the files. When I import in the v10 site, I select the one stop upgrade, I'd expect to see the nested content turned into block lists and the DTGE turned into block grid.

The nested content works as expected. Nested Content DocTypes are correctly marked as Elements, and the properties have migrated, along with their content.

However for the DTGE editors, it hasn't worked. There are Bock Grid Data Types created for each of the DTGE properties from the old site, but they have no settings, and no allowed block types. All of the property data for any of the content that was previously a DTGE is reset to empty block grid JSON.

I've also noticed that the DocTypes for the Grid elements have NOT been set as elements either. There's nothing in the Umbraco logs or uSync report that indicates there's been a problem either.

Does anyone know what could cause this, or where I should be looking for debugging? Happy to submit a PR with a fix if I can get this working!

@KevinJump
Copy link
Member

Hi,

Probably this will be because on the target site, Umbraco does not know about the config for the DTGE

Normally DTGEs are configured either in grid.config.js or the package.manifest of the DTGE plugin. On a new clean site, these custom configs might be missing so Migrations doesn't know what to do with it.

So we created the packers - that can extract not only the uSync data but also the config, then when you load the zip on the new site, we can load the configs and the DTGE settings so they can be migrated

https://github.com/Jumoo/uSyncMigrations/blob/main/GETTING-STARTED.md

The packers aren't super clever they just create a zip with these extra files so on import we can load them and hopefully do DTGE better

@Attackmonkey
Copy link
Author

Hi Kevin!

Thanks for getting back to me!

I generated the packed files, but it didn't work. The packed file contains the grid.editors.config.js file though. But it doesn't seem to be getting picked up when you run the migration on the new site?

Where in the codebase would be the best place to stick breakpoints to try and debug this? I'm using a fork of the project so I can try and debug it.

@KevinJump
Copy link
Member

Hi,

sorry I've been getting backup to speed after a couple of weeks off.

  • If you want I am more than happy to take a look you can send me the pack zip to kevin@jumoo.co.uk

when you say the its not picking up the config is that in the UI, or just evident from the fact it isn't working 😞

does the site files folder appear in the seetings when you load the pack file ?

image

if you select copy on the 'validation results' then you will get some detail on the loading of the config

image

for example - from one of our test sites :

itemType,itemName,message,messageType
BlockGird,Config,Loaded 15 editors from grid config,Success
BlockGrid,Editor,Found 'GridRTEBlockMigrator' for 'rte',Success
BlockGrid,Editor,Found 'GridMediaBlockMigrator' for 'media',Success
BlockGrid,Editor,No migrator found for 'macro' default will be used,Warning
BlockGrid,Editor,No migrator found for 'embed' default will be used,Warning
BlockGrid,Editor,Found 'GridTextstringBlockMigrator' for 'headline',Success
BlockGrid,Editor,Found 'GridTextstringBlockMigrator' for 'quote',Success
BlockGrid,Editor,Found 'DocTypeGridEditorBlockMigrator' for 'abpiQuote',Success
BlockGrid,Editor,Found 'DocTypeGridEditorBlockMigrator' for 'abpiVideo',Success
BlockGrid,Editor,Found 'DocTypeGridEditorBlockMigrator' for 'abpiLottieVideo',Success
BlockGrid,Editor,Found 'DocTypeGridEditorBlockMigrator' for 'abpiChevron',Success
BlockGrid,Editor,Found 'DocTypeGridEditorBlockMigrator' for 'buttonLink',Success
BlockGrid,Editor,Found 'DocTypeGridEditorBlockMigrator' for 'supplementaryContent',Success
BlockGrid,Editor,Found 'DocTypeGridEditorBlockMigrator' for 'contentBoxItem',Success
BlockGrid,Editor,Found 'DocTypeGridEditorBlockMigrator' for 'acceptanceCheckBox',Success
BlockGrid,Editor,Found 'DocTypeGridEditorBlockMigrator' for 'schools',Success
FileValidator,Files,File structure looks like it's Umbraco 8 🤷,Success
Version,uSync Folder,\uSync\migrate\v8_migration_2023_06_21_211105\v8 contains uSync version 8 files,Success

this shows that the migrations found 15 editors in the grid config and what they matched to.


Breakpoints

I would prob start with the 'GetContentValue` method in the GridToBlockGridMigrator class.

but if we think it is parsing the grid properly. the magic happens in GetBlockItemDataFromGridControl this (using the context) will attempt to find the migrator and do the actual conversion,

  • if for some reason the migrators are not being found you will see it here.
  • if the migratrors are not working as they should you will also see them being called but returning the wrong thing here.

for loading of the migrators, this is done when we look at the grid config file. EditorsByContext method load the grid config, inside that you will see it either loads from disk, or from Umbraco, in this case you really want it to load by disk.


Hope that helps, but do send me the file if you can and i will see if i can spot anything.

@Attackmonkey
Copy link
Author

Awesome, thanks for the pointers! I'll send you the pack file later on to see if you can spot anything amiss :)

@nickzureus
Copy link

Hi, I'm experiencing the same issue I think going from v7 to v10.

  • Document types are created - but not as elements (easy enough to manually change this in the back-office)
  • Document types are not assigned to blockgrid (again, easy enough to update)

I can then see the migrated data in the back-office but it is incomplete. From the migrated v10 DB:

{"layout":{"Umbraco.BlockGrid":[{"contentUdi":"umb://element/59ebabcac27c4e30b778be7c9ddb2ec9","columnSpan":12,"rowSpan":1,"areas":[]}]},"contentData":[{"contentTypeKey":"ca12101d-a5b1-4b0a-a121-8808ef0fe65d","udi":"umb://element/59ebabcac27c4e30b778be7c9ddb2ec9","title":"Read the full case study","outline":"“We are delighted”","detail":"<p>Lorem ipsum dolor sit amet</p>","backgroundColour":"{\r\n \"value\": \"ffffff\",\r\n \"label\": \"ffffff\",\r\n \"sortOrder\": 1,\r\n \"id\": \"1\"\r\n}","image":"[]","oR":null,"video":null,"imageHeight":"[\r\n \"[\\r\\n \\\"[]\\\"\\r\\n]\"\r\n]","imagePosition":"241","callToAction":"[{\"type\":\"External\"}]","fileURL":null}],"settingsData":[]}

Then if I manually update the document via the v10 back-office to match the original site:

{"layout":{"Umbraco.BlockGrid":[{"contentUdi":"umb://element/59ebabcac27c4e30b778be7c9ddb2ec9","columnSpan":12,"rowSpan":1,"areas":[]}]},"contentData":[{"contentTypeKey":"ca12101d-a5b1-4b0a-a121-8808ef0fe65d","udi":"umb://element/59ebabcac27c4e30b778be7c9ddb2ec9","title":"Read the full case study","outline":"“We are delighted”","detail":"<p>Lorem ipsum dolor sit amet</p>","backgroundColour":"{\r\n \"value\": \"ffffff\",\r\n \"label\": \"ffffff\",\r\n \"sortOrder\": 0,\r\n \"id\": \"1\"\r\n}","image":"[{\"key\":\"cafd7caa-f005-4eb3-81d5-00aba7913b16\",\"mediaKey\":\"a7fb474e-ddca-42dd-9991-f73c66dfdc93\"}]","oR":null,"video":null,"imageHeight":"[\"[\\r\\n \\\"[]\\\"\\r\\n]\"]","imagePosition":"Left","callToAction":"[{\"url\":\"\"},{\"name\":\"Read the case study\",\"target\":\"_blank\",\"url\":\"https://www.someurl.uk/pdf.pdf\"}]","fileURL":"[]"}],"settingsData":[]}

So 'title', 'outline' and 'detail' have gone over fine but other items not. For example imagePosition":"241" should be imagePosition":"Left". I hope this helps in some way to targeting the issue? Happy to assist if possible. :-)

@KevinJump KevinJump added the help wanted Extra attention is needed label Sep 29, 2023
@prjseal
Copy link
Collaborator

prjseal commented Oct 24, 2023

@KevinJump is this issue still open. I'm sure we had DTGE on that site you helped me with and when including the grid.config.js file in the config folder of the target site it worked.

@AussieInSeattle
Copy link

@prjseal - I'm experiencing similar issues to above and am just starting to debug/troubleshoot - all simple stuff on a DTGE that doesnt need to be migrated (like textstrings) come across fine but anything more complex like a media picker or something with pre-values that might need migrating does not work - what do you mean by "including grid.config.js" in the config folder of the target site? I'm migrating v7 to v13 - I do see grid.editors.config.js in the _site/config folder but sounds like you are saying to put the original grid.editors.config.js file from the v7 site in wwwroot/config folder of the target (v13 for me) site?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants