Question about balena preload and pin device to release

We have had an issue with our devices persistant data being erased preloaded image after boot, because we did not pin device to release.

Assuming we use the following commands from the guide:
$ balena os download raspberrypi4-64 --version 2022.10.0 --output balena-rpi4-image.img
$ balena os configure balena-rpi4-image.img --fleet cliFleet
$ balena preload balena-rpi4-image.img --fleet cliFleet --commit latest --pin-device-to-release

The image now contains a release from cliFleet.
I flash this preloaded image on to a device.
I use balena config generate and balena config inject to assign this image/device to cliFleet2.
Because the release is from cliFleet, and the device is assigned to cliFleet2, will all persistent data be erased, and the default/pinned release from cliFlete2 be downloaded? Even though the device image was created with --pin-device-to-release flag?

Can we put an identical release in cliFleet and cliFleet2 so the device is not erased in this situation?

Or must the config.json we generate always point to the fleet from which the preloaded image was taken?

Thanks,
Ben S.

1 Like

Hello @ben could you please confirm if you are using the offline update system to update your devices?

It’s similar to offline update, however these are new devices.
So the flow is identical to preloading and pregistering

1 Like

Hello @ben - that is an interesting question - is there a reason you need to assign to a different fleet than the preloaded one? What are you trying to achieve?

1 Like