# DevIDs max length before migration

**URL:** <https://www.thethingsnetwork.org/forum/t/devids-max-length-before-migration/52200>\
**Category:** Migrating Devices to V3\
**Created:** [October 7, 2021, 5:13pm UTC](https://www.thethingsnetwork.org/forum/t/devids-max-length-before-migration/52200 "2021-10-07T17:13:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecoadapt](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ecoadapt/32/35697_2.png) [@ecoadapt](https://www.thethingsnetwork.org/forum/u/ecoadapt)\
**Post date:** [October 7, 2021, 5:13pm UTC](https://www.thethingsnetwork.org/forum/t/devids-max-length-before-migration/52200/1 "2021-10-07T17:13:56Z")

</div>

Hi,

We have devices with IDs of 39 characters. The ttn-lw-migrate tool (v0.5.0 up to v0.7.0) prevents the migration of devices because of the IDs of more than 36 characters. We want to migrate our devices with sessions keys.

How can we migrate our devices ?Is it possible to increase this limit of 36 characters ?

Regards,

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [October 7, 2021, 8:00pm UTC](https://www.thethingsnetwork.org/forum/t/devids-max-length-before-migration/52200/2 "2021-10-07T20:00:24Z")

</div>

> [@ecoadapt](#):
>
> How can we migrate our devices ?

You could truncate or remap the ID’s - they are administrative but this may impact on your backend.

> [@ecoadapt](#):
>
> Is it possible to increase this limit of 36 characters ?

Very probably if you alter the source code - or lodge an issue on GitHub - but you may want to look at using shorted IDs as migration D-Day is ~54 days away

---

<div class="post-metadata">

**Author:** ![ecoadapt](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ecoadapt/32/35697_2.png) [@ecoadapt](https://www.thethingsnetwork.org/forum/u/ecoadapt)\
**Post date:** [October 7, 2021, 8:18pm UTC](https://www.thethingsnetwork.org/forum/t/devids-max-length-before-migration/52200/3 "2021-10-07T20:18:54Z")

</div>

How to truncate or remap the ID’s on v2 ? On web interface it seems we can’t do that. Maybe with CLI ? Please could you share a doc for that ?

Regards

---

<div class="post-metadata">

**Author:** ![htdvisser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/htdvisser/32/45312_2.png) [@htdvisser](https://www.thethingsnetwork.org/forum/u/htdvisser)\
**Post date:** [October 8, 2021, 8:26am UTC](https://www.thethingsnetwork.org/forum/t/devids-max-length-before-migration/52200/4 "2021-10-08T08:26:27Z")

</div>

I’m afraid increasing the limit of 36 is not possible. Doing this would be a breaking API change, and it could result in problems with (external) applications, integrations and storage databases that were built to enforce the current limit of 36.

It shouldn’t have been possible to register IDs of longer than 36 in V2 either, but an unfortunate validation bug allowed this to happen for a number of devices.

* * *

We could indeed solve this by making a change to the `ttn-lw-migrate` tool that lets you remap the IDs. Would it work for if the tool would allow you to register these devices in V3 using their DevEUI instead of their V2 ID?

---

<div class="post-metadata">

**Author:** ![ecoadapt](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ecoadapt/32/35697_2.png) [@ecoadapt](https://www.thethingsnetwork.org/forum/u/ecoadapt)\
**Post date:** [October 8, 2021, 12:04pm UTC](https://www.thethingsnetwork.org/forum/t/devids-max-length-before-migration/52200/5 "2021-10-08T12:04:30Z")

</div>

Hi htdvisser,

If we can keep sessions info from our devices before migration, your solution could help us.

---

<div class="post-metadata">

**Author:** ![system](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/6/2/6250ea44fd2b0d6259489e1a92748df681e1f970.png) [@system](https://www.thethingsnetwork.org/forum/u/system)\
**Post date:** [October 18, 2021, 2:58pm UTC](https://www.thethingsnetwork.org/forum/t/devids-max-length-before-migration/52200/6 "2021-10-18T14:58:25Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
