I need to migrate D7 variable user.data.googleanalytics.custom to D8 user.data.google_analytics.user_account_users variable.
Core seems to migrate user.data, but I cannot hook into this process to rename variables or at least I do not know how.
How can this implemented?
Comments
Comment #2
hass commentedComment #3
hass commentedComment #4
mikeryanHaven't looked at this previously myself, but it looks to me like your model should be d6_user_contact_setting.yml - basically, replace
with
Comment #5
hass commentedThe source is without underscore and destination with underscore in module name. What is index?
Comment #6
hass commentedI tried to understand this now for several hours, but do not understand what happens.
googleanalytics.customis converted to D8googleanalytics.customwith serialized valuea:1:{s:6:"custom";i:1;}and notgoogle_analytics.user_account_userswith a non-serialized value1.Comment #7
mikeryanWhat I suggested was changing the key and module in source, not adding a key and module to destination.
Try this:
Comment #8
hass commentedI can try this, but it is not logic to me. The source has a wrong module name and wrong key that do not exists in the source.
If this really works i change this into a bug for sure as it makes no sense.
Comment #9
hass commentedBoth googleanalytics.custom and googleanalytics/custom result in no data migrated to D8.
Played a bit with SkipRowIfNotSet and this does not match. This means it is a syntax issue or the string is not split by PROPERTY_SEPARATOR and therefore the array key is not found.
Comment #10
hass commentedComment #13
heddnThere seems like would be a way to rename things using static_map, etc. If I'm not reading the IS correctly, please update it. Otherwise, I think things are working as designed.
Comment #14
hass commentedCan you read all, please? And try it out. Nothing works.
Comment #18
quietone commentedTook a look at the google_analytics migration
and transform method:
The custom transform is getting a nested value from the array to test but SkipRowIfNotSet isn't designed to work with nested arrays. It just does a simple check on the value at the index, $value[$this->configuration['index'].
Fortunately, the Get plugin will get values from an array so we can do the following which allow skip_row_if_not_set to get the desired value to test.
Comment #19
quietone commentedNo reply in over two weeks, closing as works as designed. Please reopen if that doesn't solve the problem.
Comment #20
hass commentedHow can this work if source module was named
googleanalyticsand target module is namedgoogle_analytics. Somewhere I need to specify the source module I think...?I try this:
Comment #21
hass commentedSeems working. THANKS!