This section documents the process of migrating end devices from V2 to The Things Stack.
Keep in mind that V2 machines were shut down on December 1, 2021, so devices can no longer be migrated from there. It is only possible to register them from scratch on The Things Stack. However, it is still possible to migrate devices from private V2 servers, which is described in this section.
Prerequisites
- User account on deprecated The Things Network V2 or The Things Industries V2.
- User account in The Things Stack.
We recommend testing migration on a single end device or a small batch of end devices in order to make sure the migration process goes as expected.
We highly recommend using The Things Stack version 3.12.0
or higher. Some of the features (like session migration) from this guide might not be available for prior versions.
Add Application in The Things Stack
Since end devices are being created within applications, you first need to add a new application in The Things Stack. See Adding Applications for detailed instructions.
When adding an application in The Things Stack, the Application ID does not have to be the same as the one in V2.
Add Payload Formatters and Integrations in The Things Stack
After creating an application, you need to add the associated elements like application-level payload formatters and integrations.
The payload formatters can be uplink and downlink, and they are what was known in V2 as encoders and decoders. In The Things Stack, it is also possible to add payload formatters per end device, which override application payload formatters. However, before devices are migrated to The Things Stack it is only possible to add a payload formatter per application.
The format of V2 payload encoders and decoders is still supported in The Things Stack. You only need to add one additional line to the function code used in V2 to make it fully compatible with The Things Stack. For example, if your payload decoder function in V2 was:
function Decoder(bytes) {
var temperature = bytes[0] | bytes[2];
return {
temperature: temperature;
}
}
then your uplink payload formatter function in The Things Stack should be:
function decodeUplink(input) {
var bytes = input.bytes;
var temperature = bytes[0] | bytes[2];
return {
temperature: temperature;
}
}
See Payload Formatters guide for detailed instructions on how to add payload formatters and which types are supported by The Things Stack.
For detailed tutorials on the integrations that are available in The Things Stack, see Integrations.
Migrate End Devices
When you have added your application and elements associated with it, it is time to migrate your end device(s) from V2 to The Things Stack.
Since the V2 machines were shut down, ttn-lw-migrate
is no longer able to migrate devices from those servers. You can only add those entities in The Things Stack.
However, devices can still be migrated from private V2 servers to The Things Stack. There are two approaches for migrating devices, depending on how many end devices you intend to migrate and if you wish to migrate with or without active sessions, described in the following guides: