Ttn-lw-migrate fails on extra fields

I’ve defined some extra fields in my devices
“attributes”: {
“deepness”: attr[‘Deepness’],
“dev_id_knd”: attr[‘DevIdKnd’]

What’s getting me in trouble now with ttn-lw-migrate obviously checking the attributes:

./ttn-lw-migrate devices --dry-run --verbose --source ttnv2 “137-1” --ttnv2.with-session=false > devices.json
reason=value does not match regex pattern “^a-z0-9{2,}$”

Is there any way to teach ttn-lw-migrate the new fields?
And are private fields possible in v3 any more?

The field names have to match the regex pattern - there is no underscore in there.

There are your own attributes on the General Settings page for a device.

What’s not clear is if you are getting them from the migration tool.

dev_id, app_eui, dev_eui, app_key, … all contain underscores, don’t they?

And if they are imported regularly.

Thank you. Found it.

Yes, yes they do. I’m not sure how that helps.

I don’t understand what this means - I’ve used the migration tool and I’ve not seen any custom fields available from the v2 console.

I don’t understand why
reason=value does not match regex pattern “^a-z0-9{2,}$”
doesn’t get triggered by dev_id field name as dev_id_knd triggers the error.

You could add them via POST request.

v3 doesn’t accept underscores in Attributes names either. So I’ve to change the names in any case. But it would be nice if I could export devices to json and edit the json afterwards to comply with the naming rules.

Maybe they only validate the user fields.

The output from the migration tool is JSON - so you can process / grep / sed it before importing in to v3.

Yes I know, but as I cannot export I cannot edit. Is there any example data available?

I thought I knew the v2 API but I wasn’t aware you could add attributes via the CLI. I do know the v3 API pretty well. I’ve not seen any examples with attributes out of v2 or in to v3 but I’ll gladly see what might be possible.

One other potential thing to try is to use the original v2 CLI to get the device info out and process it for import.

I know this thread is a bit old, but I am currently facing the same problem when trying to export V2 devices to V3. Back in the days we used the V2 API to register devices and added custom attributes ‘deviceSN’, ‘registerDate’ and ‘registerFrom’, and the ttn-lw-migrate tool fails on these custom attributes since they do not match the regexp. Is there any way to skip this validation and let ttn-lw-migrate tool create a JSON file without these extra attributes, so that the devices can be imported in V3? Now it just fails and therefore does not produce any JSON…

Or do we need to craft the device JSON by hand in order to import the devices in V3?

Only two weeks left. I should hurry up now. pwgebben did you found a solution for our “extra field extra”?