This section refers to migrating end devices to The Things Stack using
ttn-lw-migrate migration tool.
0.5.0or higher installed on your system.
Note:See the Migration Tool guide for detailed installation instructions.
Configure the Environment
First, you need to configure a few environmental variables. Navigate to the folder where you installed
ttn-lw-migrate and execute:
$ export TTNV2_APP_ID="ttn-v2-application-ID" $ export TTNV2_APP_ACCESS_KEY="ttn-v2-application-access-key" $ export FREQUENCY_PLAN_ID="EU_863_870_TTN"
FREQUENCY_PLAN_IDvalue to the frequency plan you are using. See the list of supported Frequency Plans.
If using Windows OS Command Prompt, replace
set and remove the double-quotes in commands above:
$ set TTNV2_APP_ID=ttn-v2-application-ID $ set TTNV2_APP_ACCESS_KEY=ttn-v2-application-access-key $ set FREQUENCY_PLAN_ID=EU_863_870_TTN
Be aware that setting environmental variables using Windows PowerShell is slightly different. For example, you would set the
TTNV2_APP_ID variable as follows:
If you are migrating end devices from a private The Things Industries V2 (SaaS) cluster, you need to configure one extra environmental variable:
$ export TTNV2_DISCOVERY_SERVER_ADDRESS="<instance-id>.thethings.industries:1900"
Note:If the Discovery Server of your private The Things Industries V2 (SaaS) cluster does not use TLS, you will need to use
ttnv2.discovery-server-insecureflag when running commands with the
Export End Devices from V2
Next, you can proceed with exporting one or more end devices, with or without their active session, from V2 to a JSON file.
Note:Migrating end devices from V2 to The Things Stack is a one-way process, since LoRaWAN devices may be handled by only one Network Server at a time.
Now, read the following subsections for detailed steps on how to migrate devices from V2 to The Things Stack using