While upgrading a MediaWiki installation I ran into the error
Query: INSERT INTO `actor` (actor_name) VALUES ('RedirectBot')
Error: 1062 Duplicate entry 'RedirectBot' for key 'actor_name' (localhost)
maintenance/upgrade.php. The problem bit quite a lot of people with
older MediaWiki installations. And while the official bug report
is mildly interesting to read, there hasn’t been a solution since July 2019.
In my case it was rather easy to identify the problem. MediaWiki saves the
user_id with every revision. In this case the user
had two different
user_ids, 860 and 200012. I fixed this by making sure that
revision entries for
RedirectBot have the same
delete from actor where actor_name like 'Redi%';
update revision set rev_user=200012 where rev_user=860;
update.php worked as it should.