As designed Upgrading from XF 1.5 doesn't seem to be keeping super admin status

Affected version
2.2.1

Jake B.

Well-known member
I believe previously if you did an upgrade from XF 1.5 it'd correctly keep your super admin status based on the config.php value. However, when doing an upgrade from 1.5.x to 2.2.1 this no longer seems to be the case
 

Brogan

XenForo moderator
Staff member
Is the super admin status actually being removed?

The config.php file is no longer used to denote super admin in XF2 - it's done in the ACP.

1605557139196.png
 

Mike

XenForo developer
Staff member
Did you manually create a new config file without the legacy super admin elements? If so that would do it. The built in tool to create the new file will migrate the super admin definitions across and the upgrade will pick that up.
 

Jake B.

Well-known member
Hmm, I've done quite a few XF1 -> XF2 upgrades and haven't encountered that.

Yeah, it's the first time I've encountered it, but also the first time I've done a 1.x to 2.2 upgrade

Did you manually create a new config file without the legacy super admin elements? If so that would do it. The built in tool to create the new file will migrate the super admin definitions across and the upgrade will pick that up.

Nope, went into the admin panel to start the upgrade, it created the new src/config.php and then I ran the upgrade from the CLI. The super admin line is still in src/config.php as well
 

Mike

XenForo developer
Staff member
Were the super admins in src/config.php actually admins? If there were IDs specified there but none of them were actually admins, then this could happen. We have code that tries to prevent the situation where there are no super admins during upgrade, but we trust the config.php value if we get something there, so it doesn't run the code in that case.

Since there were no super admins, that makes me think that it did actually read the value from the config file, but then it couldn't find any of the IDs in the xf_admin table.
 

Jake B.

Well-known member
Yeah, looks like that was the case. Had 5 IDs listed, but none of them matched an actual administrator user. Not sure how it went unnoticed that nobody was a super admin, but apparently it did
 

Mike

XenForo developer
Staff member
We've noted the situation and will keep an eye out to see whether other people run into it, though as things stands, what happened is roughly expected.
 
Top