Here's an ONLY PARTIALLY TESTED suggestion using the sqlite3 utility program. Like you said, you should only try this on copies
of both databases. Then when you're satisfied, you can replace your live database with the fixed copy.
Start sqlite3, attach both the "good" and the "bad" databases, then execute an UPDATE statement for a range of dates. In this example, db1 is the
database that gets fixed, and db2 has the correct rain values.
.attach database 'weewx.sdb' as db1
.attach database 'weewx2.sdb' as db2
update db1.archive set rain = (select rain from db2.archive where db1.archive.datetime == db2.archive.datetime)
where date(db1.archive.datetime, 'unixepoch', 'localtime') between '2021-01-01' and '2021-05-01';
.exit
Then I'd start sqlite3 again and do some select queries to validate that all is good in db1.
Walt