Can I rewrite the xmps for all my image files in a simple way?

Firstly, could you please hold valid responses along the lines of “why would you want to do that?”, until later? Thanks.

I assume that data.db holds the definite state of any image’s xmp data, even after I take the option to ‘keep xmp data’ in preference to ‘keep database data’ when dt detects an updated xmp file on start-up. Given that assumption, is there a simple way for me to rewrite the xmp files, from data.db, for all my images, to make sure they are all up to date?

Maybe delete the xmps, then use the write xmp button in lighttable? Don’t take my word for it though - not sure how the database interacts with xmps depending on settings.

Edit: maybe no need to even delete them… I mean this button:

Yes, I had been using this approach, but only on the images in the ‘lowest level’ folder in my folder tree starting at ‘Pictures’. And this then implied a very labourius process, as I have hundreds of such folders.This was on the basis of thinking (in the absence of any evidence) that dt might have a conniption of I picked a folder with, say, 1000 images in it. But I just tried it, without problems, updating the database on a different PC entirely. I’m still a little nervous about pointing the ‘write sidecar files’ at the whole portfolio though!