@Howard ...
"I'm going to suggest that what you did to solve whatever problem you had in the first place may not have been the best solution."
+20 to that!
As is normal for the OP who posted, details are forever not forth coming ...
User ID's 38,5,418,421 doesn't include user id 2, which, as we know, was the original id of the user that installed the site.
So am wondering ... did OP delete the row in mdl_user table for ID 2?
Must be the OP's command line only server which has yet to be migrated. OP did mention 'other server' ... hmmmm, wonder if that's the one installed with Softac and a course was restored that had his account in the course as whatever ... expected his account to be made admin level. More hmmmmmmmm.
@OP ... did you tell the owner of the site that you were doing this? If not, that's worse than doing a non-evasive port scan!!!! Don't answer that for that would be 'exposing' yourself. :|
Yep, learning to admin a moodle as well as migrate a site is a rather tall mountain ...