TheThingsIndustries / lorawan-stack-docs

Documentation for The Things Stack
Apache License 2.0
29 stars 65 forks source link

Document how to use the CLI to move a device between apps while keeping the session alive #1257

Closed dajtxx closed 4 months ago

dajtxx commented 5 months ago

Summary

It is not obvious how to move a device from one app to another, nor is it obvious how to keep the session alive. I pieced together the process with experimentation and use of the JSON file reference page.

It would be useful to have a page with example commands on how this can be done. ...

Why do we need this ?

Wanting to move devices between applications is sometimes desirable and having to reboot a device is not convenient if it is not necessary.

What is already there? What do you see now?

The JSON file reference is good, but I think it is missing a field as reported in another issue.

The CLI documentation is mostly just a web rendering of the in-built help but does not explain how to use it. ...

What is missing? What do you want to see?

The process I have come to, and which I don't know to be correct is:

Export a device.

ttn-lw-cli dev get <app-id> <dev-id> --name --description --lorawan-version --lorawan-phy-version --frequency-plan-id --supports-join --root-keys --session >dev.json

Delete the device from the original app.

Delete all the fields from the JSON file not mentioned in the JSON file reference page.

Create the device in the new app.

ttn-lw-cli dev create --application-id <new-app-id> <dev.json

How do you propose to document this?

Either:

Can you do this yourself and submit a Pull Request?

No.

KrishnaIyer commented 5 months ago

Thanks. We'll look into this request.

dajtxx commented 5 months ago

See my comments on this issue for a more reliable way of moving devices between applications.

KrishnaIyer commented 4 months ago

So moving devices between applications is currently via the migration tool https://github.com/TheThingsNetwork/lorawan-stack-migrate.

If you run into issues, please create an issue there.