Re-apply geolocation for all photos in digiKam

I’ve spent weeks to go through all my albums in digiKam and manually geotag them using the geolocation tool in preparation to feed them into Immich.
Their location wasn’t shown in Immich and I realised that the location information is not stored in the Exif tags by digiKam unless you tick a box in the settings. It probably saves the location in its database instead.
Now I need to find a way of having digiKam to re-apply the position to reach photo so that it worked them into the files. One way I found is to go through the albums 1 by 1 again, mark all photos and open them in the geolocation tool. Then right click them and select “get missing heights information”. This will set the status of the photos the height was added to “modified” which will write the Exif information when you exit the geolocation tool.
But unfortunately heights information is not found for all photos and the only other way I found is to select each photo and click apply in the dialog where you can enter the coordinates manually.

So long story short, is there a way to write the geolocation of all my photos from the digiKam database into the Exif tags of the files?

You can use the maintenance tool to write the metadata from the database to the images.
Open maintenance tool, select all or corresponding albums, activate the metadata synchronization option and select the direction - database to image.

Maybe first select a small album to test whether everything works as you expect.

Thank you very much for the information. That is exactly what I needed.