This is for if you:
First a little explanation of how Batocera is laid out on your drive, as this will help in understanding exactly what files need to be placed where later on:
/boot/ during boot. The read-only batocera SquashFS file is also contained in the boot partition. On boot, this filesystem is mounted at / to run Batocera proper. You'll also find batocera-boot.conf here. In Batocera v31 and lower, the custom splash videos you have uploaded would be copied here too. This partition is assigned 6 GB of space (4 GB with older images of Batocera), with 2 GB used by Batocera. Files in only this partition are overwritten when updating Batocera; it's relatively simple to upgrade/downgrade Batocera versions because of this design.batocera.conf). This partition is not touched when upgrading/downgrading. This is designed to be portable between all versions of Batocera, even Batocera builds running on different platforms (granted, weaker platforms like SBCs won't magically gain the ability to play ROMs for emulators they don't have).
In Batocera 5.23 and higher, it is advised to upgrade/downgrade using the batocera-upgrade command via SSH. Grab the URL of the version you want to upgrade/downgrade to and run batocera-upgrade [URL]. For example, to upgrade to the latest stable for x86_64:
batocera-upgrade https://mirrors.o2switch.fr/batocera/x86_64/stable/last
Or to downgrade to a specific older version, like in the example below to downgrade to Batocera 36 for PC x86_64. Don't copy that command on another architecture like a Raspberry Pi, you need to adapt the URL to it.
batocera-upgrade https://mirrors.o2switch.fr/batocera/x86_64/stable/36/
In Batocera 39 and higher, you can manually download the boot.tar.xz file to /userdata/system/upgrade. Then type
batocera-upgrade manual
The command cat /boot/boot/batocera.board can be used to display the arch that should be used. For example, on a PC this will display x86_64.
You should then see output similar to this:
Starting the upgrade... url: https://mirrors.o2switch.fr/batocera/x86_64/stable/last/boot.tar.xz need to download 1876mb /userdata/system/upgrade/boot.tar.xz 0%[ ] 9.55M 1.82MB/s eta 19m 42s
For very old versions, from Batocera 5.7 to 5.22, the command (for PC x86_64, please adapt to the right architecture) would instead be:
/recalbox/scripts/recalbox-upgrade.sh https://mirrors.o2switch.fr/batocera/x86_64/stable/last
These commands download the compressed upgrade (or potentially downgrade) file and expand it to overwrite the Batocera system on the boot partition. Upgrading or downgrading like this doesn't remove any of your user data (ROMs, saves, metadata…). Like never, ever.
On the next reboot of Batocera, it will instead use the upgraded version. If the automatic upgrade tool is not suitable for your purpose, then you can manually upgrade/downgrade as specified below instead.
In Batocera v38 ( confirm versions) and higher, the following procedure will wipe your userdata if the
autoresize=true flag is uncommented in batocera-boot.config. You have been warned…
To upgrade/downgrade manually from a downloaded boot.tar.xz file:
boot.tar.xz file of the version you want. The official ones are available at https://mirrors.o2switch.fr/batocera/ (for older versions, navigate to your architecture and go to /stable/last/archives/). Here's a list of architectures and links to their builds.batocera-boot.conf and config.txt) from the Batocera machine (if you have edited them and require the edits to boot properly) to a safe location.boot.tar.xz file (it's just like a .zip, you can use 7-zip on Windows) to get the boot.tar file.boot.tar file into the root of your Batocera drive's boot partition (this is the default partition you see when inserting the drive into Windows) and overwrite the existing files. You may have to assign a drive letter under Windows Disk Management to see it in the file explorer.Ordinarily, the built-in updating tool will do all of the following automatically:
/userdata/system/upgrade/boot.tar.xz in the userdata partition/boot/batocera-boot.conf to /boot/batocera-boot.conf.upgrade and /boot/config.txt to /boot/config.txt.upgrade/userdata/system/upgrade/boot.tar.xz to /boot//boot/batocera-boot.conf.upgrade to /boot/batocera-boot.conf and /boot/config.txt.upgrade to /boot/config.txt/userdata/system/upgrade/boot.tar.xzIf you get an error message telling you that you don't have enough space on your userdata partition to download the file, there might be several reasons:
boot.tar.xz file.To work around there not being enough free space in the userdata partition, you can do any of the following:
boot.tar.xz file.boot.tar.xz from the server for the intended Batocera version onto another computer, connect the Batocera drive to it, and extract the contents of boot.tar directly to the boot partition of Batocera.If you get an error message telling you that you don't have enough space on your Batocera boot partition while attempting to upgrade, there might be several reasons:
/boot partition) are/is taking up too much space. Remove them/it, reboot and try to upgrade again./boot partition was initially assigned less space (compared to installations of newer Batocera versions).To work around there not being enough free space in the boot partition, you can do any one of the following:
Flash a spare USB/portable hard-drive with a new copy of Batocera and boot into that, copy all your /userdata/ (everything in Share) from your old Batocera drive to your spare USB/portable hard-drive and then reflash the old Batocera drive with a new version of Batocera (or just continue to use your spare USB/portable hard-drive).
Backup your /userdata/ to another device (you may lose file attributes by doing this, causing problems with WINE/Cemu) and reflash Batocera.
Extend the boot partition of your drive using an advanced tool like gparted or GNOME Disks (a.k.a. gnome-disk-utility). This will likely destroy your userdata partition, so back up all your ROMs, saves, configs, etc. first. This may cause irreversible damage to your drive and it may damage the MBR/GPT table, causing the drive to become unbootable. Consider the other options or just staying on your current version of Batocera. Batocera v30 requires at least 6 GB total assigned to the boot partition and 2 GB free space in the userdata partition to be able to use the built-in updater.
Use another computer to extract the update files onto the Batocera drive. Be aware that by doing this you would have to do this manual workaround every time you need to update.
/boot/batocera file from the Batocera drive (it is just called batocera without a file-extension and is about 2 GB large (smaller in older versions)).
Ensure that you are actually deleting the file and not just sending it to the recycle bin of your OS. This can be done in most operating systems by holding [Shift] and then tapping [Del] with the file selected. Check that the remaining free space on the drive lowers to confirm this.
If Batocera fails to boot, you can restore the data you backed up in step 2.
Remove the old version of Batocera before overwriting it with the update. Be aware that by doing this you would have to do this manual workaround every time you need to update.
mount -o remount,rw /boot
/boot/boot/batocera file to another device or the userdata partition if you have enough space there (cp /boot/boot/batocera /userdata/system/batocera-backup, or you can exit the xterm with [Alt]+[F4] and then use the file manager to copy the file to your /userdata/system/ folder)batocera file and immediately upgrade: rm -i /boot/boot/batocera && batocera-upgrade
Confirm the file you want to delete.
You should then get an output that looks like this:
Starting the upgrade... url: https://mirrors.o2switch.fr/batocera/x86_64/beta/last/boot.tar.xz need to download 1876mb m/upgrade/boot.tar.xz 0%[ ] 9.55M 1.82MB/s eta 19m 42s
If Batocera fails to boot, you can restore the backup you made in step 2 and then remove it with (replacing the first path if you used a different location for your backup):
cp /userdata/system/batocera-backup /boot/boot/batocera && rm /userdata/system/batocera-backup