I am trying to move a device from one application to another application on the same server. I can export the device and remove it from the source application with the command:
ttn-lw-migrate device --source ttnv3 <device_name> --ttnv3.app-id <source_app> … --ttnv3.delete-source-device > device.json
but then I try to import it with:
ttn-lw-cli end-devices create --application-id <dest_app> < device.json
then I get a bunch of errors:
INFO Device not configured for claiming, register in the cluster Join Server
error:pkg/errors:validation (invalidend_device
: embedded message failed validation)
reason=embedded message failed validation
name=CreateEndDeviceRequestValidationError
field=end_device
correlation_id=b02521f198654b8db99299e5590c507e
— error:pkg/errors:validation (invalidclaim_authentication_code
: embedded message failed validation)
field=claim_authentication_code
reason=embedded message failed validation
name=EndDeviceValidationError
correlation_id=84ddb7c6e11746ff9f2620cf753aaccb
— error:pkg/errors:validation (invalidvalue
: value does not match regex pattern “[1]{1,32}$”)
reason=value does not match regex pattern “[2]{1,32}$”
name=EndDeviceAuthenticationCodeValidationError
field=value
correlation_id=050a1b4ab73741f9899e79a86c3209f8
However if I got through the web UI and select “Import end devices” and select device.json, then the import is successful and I see the device in the new application. So either I am missing some parameters for “ttn-lw-cli end-devices create” or the gui does some additional steps. Any ideas?