This worked perfectly for me, thank you! I had noticed that Radarr's Acitvity > History wasn't updating with new events following a restore I made last week. Found the logging containing 'Database disk image is malformed' and found my way here after about 10 minutes of searching. Your script worked first time - my existing history is there still and new events are being added as you'd hope. I'm on Unraid 6.12.13 in case anybody happens to care when finding this post later on