Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Congrats, you decided to jump from the community network to a private LoRaWAN network and you might want to transfer your existing applications, devices and gateways to the new server. For each element, there are two ways of migrating; either through the console or through the command-line tool ttnctl (follow this guide first, if you are planing this).


If you have a great number of apps, devices or gateways to migrate you can contact The Things Industries support to plan a migration by us. The subsequent methods can be time-consuming and error-prone so be careful.

Info

See the scripts


Migrate an application

First thing you should do is to "migrate" you application. To do this, it is only necessary to create a new application and add the previous application EUI to the new one. If you have collaborators, third party or MQTT client you will have to set them with the new access keys generated by the application; don't forget to reconfigure your MQTT client to the right url and broker. 

With the console

  1. Go in your application on TTN console.
  2. Navigate to your application, Settings > EUIs
  3. Note all the EUIs
  4. Now open a new tab/windows of your internet browser and go to your private console at console.<domain>.thethings.industries.
  5. Click on Applications.
  6. Then Register application.
  7. Enter your application info. The Application ID doesn't have to be the same as the same as the previous application. Also, leave the Application EUI as is, we will look into that later.
  8. Go into you your newly registered application Settings then EUIs and click addEUI.
  9. Click on  to enter a custom EUI. Add the EUI of the previous application.
  10. Repeat steps 8 and 9 as many times as you have EUI for your previous application.


With ttnctl

Make sure you followed this guide first  first!

  1. Retrieve your TTN application information, ex: 

    Code Block
    $ ttnctl --config ~/ttnctl/community.yml application select yourAppID
      INFO Found one EUI "YOUR_APP_EUI", selecting that one.
      INFO Updated configuration                    AppEUI=YOUR_APP_EUI AppID=yourAppID


  2. Add a new application to your network server with the a previous EUI (YOUR_APP_EUI, in the code above).

    Code Block
    $ ttnctl --config ~/ttnctl/private.yml applications add yourappid myapp --app-eui YOUR_APP_EUI
      INFO Added Application                       
      INFO Selected Current Application  


Migrate gateways

The task isn't any different than registering a your existing gateway on the public network. For more information look at this article and this one.

.

Don't forget to un-register your gateway from the public community network.

Instructions on how to forward packets to the public network and private network will be released the same time as TTN V3.


Migrate devices

This is the most time-consuming step. If you have a lot of devices to migrate you can contact The Things Network support to plan for a complete migration or if you have someone adept of command-line tools and scripting it might be able to do it fast.

With the console

Be warned, if you have more than 20 devices this may take a lot of time. It is also recommended to work with two tabs or windows, one on the community console and one on your private console.

  1. Go into your TTN application and private application device registery registry (Application > YourApp > Devices).
  2. In your public app; click on the device you want to migrate.
  3. In you your private app;
    1. click add a Device.
    2. Enter the Device ID you want, it doesn't matter.
    3. Copy/Paste the Device EUI from the TTN device to the new device.
    4. Copy/Paste the App Key from the TTN device to the new device.
    5. Select the App EUI matching the TTN application EUI.
  4. Repeat for all the devices you want to migrate.


With ttnctl

Make sure you followed this guide first  first!

  1. Select your TTN application and your private app.

    Code Block
    $ ttnctl --config community application select yourapp
    $ ttnctl --config private application select yourprivateapp


  2. List your device.

    Code Block
    $ ttnctl --config community devices list        
      INFO Using Application                        AppEUI=70B3D57EF00069B5 AppID=yourapp
      INFO Discovering Handler...                   Handler=ttn-handler-eu
      INFO Connecting with Handler...               Handler=eu.thethings.network:1904
    
    DevID  AppEUI                  DevEUI                  DevAddr         Description
    mydev  70B3D57EF0000000        0004A30B001B0000        2601278D                   
    
      INFO Listed 1 devices                         AppID=yourapp
    


  3. Get your device info.

    Code Block
    $ ttnctl --config community devices info mapper
      INFO Using Application                        AppEUI=70B3D57EF00069B5 AppID=yourapp
      INFO Discovering Handler...                   Handler=ttn-handler-eu
      INFO Connecting with Handler...               Handler=eu.thethings.network:1904
      INFO Found device                            
    
      Application ID: yourapp
           Device ID: mydev
           Last Seen: 2017-08-16 15:39:33.799601267 +0200 CEST
    
        LoRaWAN Info:
    
         AppEUI: 70B3D57EF00069B5
         DevEUI: 0004A30B001B0000
        DevAddr: 2601278D
         AppKey: 19E981CFF2F1F69089437CD896370000
        AppSKey: FFA1F9DDD9AFE354F9F14433C002D390
        NwkSKey: B6ACE4BE26EF1D496DBFE11107D7D0F4
         FCntUp: 15
       FCntDown: 0
        Options: FCntCheckEnabled, 32BitFCnt
    


  4. Add your device to the private app with the previously collected information (DevEUI and AppKey).

    Code Block
    $ ttnctl --config private devices register myprivatedev DevEUI AppKEY


    Info

    If you have ABP device you also need  to migrate the DevAddr:

    Code Block
    $ ttnctl --config private devices set myprivatedev --dev-addr DevAddr



  5. Repeat steps 3 to 4 for each device you want to migrate.


Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@50cdc531
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ( "tti" , "device" , "migration" , "gateway" , "ttn" , "configuration" ) and type = "page" and space = "TKB"
labelsTTN TTI Migration Gateway Device Configuration


Page Properties
hiddentrue


Related issues