How test OS upgrade functionality

Hi, I was wondering how we can test balena OS upgrade. We have installed latest OS on RPi hence upgrade is not available. Therefore we have downgraded to a previous version but with such image the device does not shows up in the dashboard because I think the image has issues. What can we do?


Hi, I am assuming by downgrade you mean you flashed an older image on the SD card? If the device doesn’t show up it might be due to a number of issues, such as the device failing to connect to the network. Which OS did you downgrade to? Once you are on an older OS version you can just upgrade the OS from the dashboard either from the device list page (under Actions) or in the device summary page.

HI, ok i was able to upgrade. Maybe as you said it was a problem with connectivity or image.
A question though: on the SF I had the version 2.38, afterwards I have flashed the SD with v2.36 (to downgrade). I have noticed though that the containers that I had on previous image were not removed, they were indeed also in the downgraded image. Hence my question: am i correct that flashing the OS overwrites the partition resin-boot and resin-rootA only? I mean, the resin-data is not erased across flashes?

Hi @banto-78,

Just to clarify, you created an application and then flashed an RPi with version 2.38 onto an SD card, which ran your application.

Then you reflashed the SD card with version 2.36 and then ran that but the application images still existed on the SD card? The act of flashing the SD card should totally erase everything on it, including the data partition. However, of course, when the RPi starts up with the new 2.36 based image, it will still be using the application you’ve created and download the application images and and start running them. Are you also seeing old application data stored that is pre-existing from the previous 2.38 flash?

I’d like to clarify this, as if there is still pre-existing data on the SD card, we’d like to look into this further.

Best regards, Heds

Hi again,

Just a followup note to add I’ve just tried the same thing here, and I don’t see any persistent data from the old version (which is what I’d expect). I have:

  1. Flashed an SD card with a 2.38 Rpi3 device image for an application
  2. Created both container data and host-based in the permanent storage partition
  3. Flash the same SD card with a 2.36 Rpi3 device image for the same application
  4. Checked to ensure the permanent storage partition no longer contain the old data (they do not)

If you’re not seeing this, could you let us know the exact device you’re using, the SD card make/model/size, the way in which you’re flashing the balenaOS images to that SD card and any other relevant details that might help us.

Best regards, Heds

thanks. I am not sure if i can check container data since I do not think I was storing data from container. Or how can i check that? Do i need to mount a volume in the perm storage and write into that?
However can you pls elaborate more about why a new the flashed image is still able to see and run the containers installed on previous image? Is it because the balenaCloud repository is “telling” the device (identified by ID) to download the containers?


Hi @banto-78 ,

I think there’s some confusion here. It does indeed sound like data is not being persisted across host OS flashing.

To clarify, any balenaOS version downloaded for an application will run the docker services associated with that application.

The balenaCloud service allows you to create an application, which consists of one of more docker services which are run on a device. Any device provisioned against the application will therefore download and run the docker services associated with it. This allows customers to carry out fleet management by provisioning devices with the same image, knowing that each device will run the application associated with it.

What you’re seeing is exactly what should occur. Regardless of the version of the host OS, the same application will run on any device provisioned with a device image assocated with the application being used to download the image. If you need devices to run different services, then a new application should be created with the different services required and devices provisioned with images associated with that new application.

balenaOS versions do not alter a version of an application, they are different versions of the Operating System that a device runs, where later versions of balenaOS include the latest features/bugfixes for the OS, they don’t version the application.

If you want to run different release versions of a single application, you can use staged versioning (release pinning), documented here:

Hopefully this clears up any confusion! Please let us know if you have any other questions.

Best regards, Heds

Thanks lot for this great explanation. Clear now!

You’re most welcome! Please let us know in future if there’s anything else we can help you with!

Best regards, Heds