Is it possible to migrate a device from BalenaCloud to a OpenBalena server without being in the same network as the device?
The possibility that I’m seeing is to add and run a script from the BalenaCloud SSH interface, that makes the necessary changes to the config.json file. Is that possible? The script would backup the original config.json and restore it if anything goes wrong.
Another possibility that I’m seeing: there’s always at least two Balena devices in it location. Can I use one device to access and migrate the other one?
Hello, yes the approach you outline should work. Keep in mind, if you are using a later version of the OS, there is a systemd file watcher that triggers on any changes to config.json (it immediately restarts the VPN, balenad, etc.), so please make sure you test your scripts(s) somewhere safe first because if the system can’t register/access the new apiEndpoint in config.json, it will almost certainly become inaccessible.
Other that that, as long as the device is able to access your openBalena instance apiEndpoint using the apiKey in the new config.json, and that instance is configured correctly, the device should disappear (offline) from balenaCloud and appear (online) on your openBalena instance.
The same approach should work in reverse, though since openBalena doesn’t have SSH/terminal, it would make reversing more involved.
I’m curious about your comment regarding SSH/Terminal on openBalena. Does it not support it? I have indeed tried to make it work but was unable to and paused the works on it to focus on the migration script.