Discovery:app_id not found

I’m attempting to use the ttn-lw-migrate tool on Windows 10. I have Go installed and the tool compiled successfully AFAICT. The instructions mention “export TTNV2…” but I can’t get any of the export commands to function. it doesn’t recognize export… So IDK if that’s just an OS-specific function or I’m doing something wrong… I noticed elsewhere using “set TTNV2…” for the environment variables, so i tried that instead. It seemed to take the commands. But when I try to do a dry run, it tells me the app_id is not found

E:\TTN_Migrate\lorawan-stack-migrate>set TTNV2_APP_ID="smarterbham-quick-start"

E:\TTN_Migrate\lorawan-stack-migrate>set TTNV2_APP_ACCESS_KEY="ttn-account-v2._xxxxxxxxxx"

E:\TTN_Migrate\lorawan-stack-migrate>ttn-lw-migrate device --source ttnv2 "pcom_dust-27" --dry-run --verbose > devices.json
Error: error:go.thethings.network/lorawan-stack-migrate/pkg/source/ttnv2:no_frequency_plan_id (no frequency plan id)
error:go.thethings.network/lorawan-stack-migrate/pkg/source/ttnv2:no_frequency_plan_id (no frequency plan id)

E:\TTN_Migrate\lorawan-stack-migrate>set FREQUENCY_PLAN_ID="US_902_928_FSB_2"

E:\TTN_Migrate\lorawan-stack-migrate>ttn-lw-migrate device --source ttnv2 "pcom_dust-27" --dry-run --verbose > devices.json
 DEBUG [core]parsed scheme: ""
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{discovery.thethings.network:1900  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "discovery.thethings.network:1900" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000d18db0, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000d18db0, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call failed                  auth-type=key duration=97.609ms error=rpc error: code = NotFound desc = discovery:app_id:"smarterbham-quick-start" not found method=/discovery.Discovery/GetByAppID service-name=ttn-lw-migrate service-version=2.x.x
Error: rpc error: code = NotFound desc = discovery:app_id:"smarterbham-quick-start" not found
rpc error: code = NotFound desc = discovery:app_id:"smarterbham-quick-start" not found

E:\TTN_Migrate\lorawan-stack-migrate>set TTNV2_DISCOVERY_SERVER_ADDRESS=discover.thethingsnetwork.org:1900

E:\TTN_Migrate\lorawan-stack-migrate>ttn-lw-migrate device --source ttnv2 "pcom_dust-27" --dry-run --verbose > devices.json
 DEBUG [core]parsed scheme: ""
 DEBUG [core]scheme "" not registered, fallback to default scheme
 DEBUG [core]ccResolverWrapper: sending update to cc: {[{discover.thethingsnetwork.org:1900  <nil> 0 <nil>}] <nil> <nil>}
 DEBUG [core]ClientConn switching balancer to "pick_first"
 DEBUG [core]Channel switches to new LB policy "pick_first"
 DEBUG [core]Subchannel Connectivity change to CONNECTING
 DEBUG [core]Subchannel picks a new address "discover.thethingsnetwork.org:1900" to connect
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000548d60, {CONNECTING <nil>}
 DEBUG [core]Channel Connectivity change to CONNECTING
 DEBUG [core]Subchannel Connectivity change to READY
 DEBUG [core]pickfirstBalancer: UpdateSubConnState: 0xc000548d60, {READY <nil>}
 DEBUG [core]Channel Connectivity change to READY
 DEBUG rpc-client: call failed                  auth-type=key duration=91.0758ms error=rpc error: code = NotFound desc = discovery:app_id:"smarterbham-quick-start" not found method=/discovery.Discovery/GetByAppID service-name=ttn-lw-migrate service-version=2.x.x
Error: rpc error: code = NotFound desc = discovery:app_id:"smarterbham-quick-start" not found
rpc error: code = NotFound desc = discovery:app_id:"smarterbham-quick-start" not found

Which version and, out of curiosity, what was wrong with the pre-compiled version based on a release rather than the source?

The API key you have is for the app id of smarterbham-quick-start which is on v2?

You don’t have to SET the fields, you can specify them on the command line thus:

ttn-lw-migrate.exe device --verbose --dry-run --ttnv2.app-id “app-id-of-the-app-on-v2” --ttnv2.app-access-key “ttn-account-v2.larlarlarlar” --ttnv2.frequency-plan-id “EU_863_870_TTN” --source ttnv2 “device-id-of-device-in-the-app-on-v2”

I installed go based on the instructions found on another post, directly from go’s site. “go version” reports go1.16.5 windows/amd64

I was following the instructions from another post and it said I needed to compile.

the instructions weren’t particularly clear about specifying things on commandline.

Application_id “smarterbham-quick-start” is in fact on v2 console. the API key was copied out from the access key feature at the bottom of the application/console page. It’s blanked out with xxx above for obvious reasons

I had to change some of your commands as it didn’t like them (Maybe a typo) but think it finally ran correctly…

E:\TTN_Migrate\lorawan-stack-migrate>ttn-lw-migrate device --verbose --dry-run --ttnv2.app-id=“smarterbham-quick-start” --ttnv2.app-access-key “ttn-account-v2._xxxxxx” --ttnv2.frequency-plan-id=“US_902_928_FSB_2” --source ttnv2 <devices.txt > devices.json

I was thinking of the version of the migration tool - there were important changes between v0.5 to v0.6 - and there is no need to compile, the apps are provided ready to run.

Have you checked out the official documentation?

I tried to migrate my device (still active in V2) via the migration tool in ubuntu and windows as well (with set instead of export):
InkedMigration-Try1_20211103

Writing the 4 commands into 1 line as shown here also lead to the error “no_app_id”. What is going wrong?
Best regards, Thomas