I am working on a migrate script in D8 that pulls from a MySQL DB and will populate a table in D8 created by this module...
https://github.com/bjaxelsen/field_ipaddress This module is a D8 port of this one... https://www.drupal.org/project/field_ipaddress
anyways I got the module installed and added the field to the accounts with the unlimited number of values.
A general user migrate was already made and works fine. It will migrate the username, email, and status into Drupal and all is good here.
The second migration is to move a list of user IP addresses into D8. My dataset will look like this...
user_id slstatus status_id ipFrom ipTo modifyDateUnix
50374 1 0 1.1.1.1 1.1.1.1 1505415351
25108 0 1 4.4.4.0 4.4.4.255 1479243329
The real code runs the INET_ATON function in mysql to return integers, but the above to show the intent.
In the prepare row function I also take the IP Addresses and convert them into hex values, which is needed for the db table storage.
slstatus relates to the user's active status and status_id relates to the ip record's status. These are used to determine a new variable called deleted. I also make an variable called idx which is a...well an index. All of these new fields are added back to the row.
My YAML looks like this and is where my headache begins...
id: UserIpsMigrate
migration_group: 'UMG'
label: 'User IP Migration'
source:
plugin: UserIpsMigrate
process:
'field_ip_address/bundle': 'user'
'field_ip_address/deleted': deleted
'field_ip_address/entity_id':
plugin: migration_lookup
migration: UserMigrate
source: user_id
'field_ip_address/revision_id':
plugin: migration_lookup
migration: UserMigrate
source: user_id
'field_ip_address/langcode': 'en'
'field_ip_address/delta': idx
'field_ip_address/field_ip_address_ip_ipv6': 0
'field_ip_address/field_ip_address_ip_from': ipFrom
'field_ip_address/field_ip_address_ip_to': ipTo
destination:
plugin: entity:user
default_bundle: migration
migration_dependencies:
required:
- user_migrate
The errors I am getting show that this migration is trying to create a user...which will fail with this data and so I am certain I need to use a different destination plugin, but I have no idea... 1) which destination plugin that I should be using 2) if I went "off the rails" with my yaml