• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Problems after SQL User tables Uploaded

#1
I've had an incident which got my all of my current users to have been deleted, and I got a recent SQL backup of the users from the SQL tables from my host, and for some reason, I log into the ACP, and I have complete control and I am indeed listed as a Super Administrator as expected, but I'm getting this screen on my main forums page for some reason:

Screen Shot 2015-07-22 at 11.52.36 PM.png

Any help on what the problem may be? Is it something locally on the forums or something that is happening within maybe one of the PHP files.. or?? I really don't know.

Thanks!
 

Jake Bunce

XenForo moderator
Staff member
#2
Find your user in the Admin CP:

Admin CP -> Users

Note the usergroups for that user.

Check the permissions for those groups:

Admin CP -> Users -> List User Groups

Admin CP -> Applications -> Display Node Tree -> Permissions

And finally, if all of that checks out, then try rebuilding the user cache (which will rebuild the permission combo id for all users):

Admin CP -> Tools -> Rebuild Caches -> Rebuild User Cache
 
#3
Find your user in the Admin CP:

Admin CP -> Users

Note the usergroups for that user.

Check the permissions for those groups:

Admin CP -> Users -> List User Groups

Admin CP -> Applications -> Display Node Tree -> Permissions

And finally, if all of that checks out, then try rebuilding the user cache (which will rebuild the permission combo id for all users):

Admin CP -> Tools -> Rebuild Caches -> Rebuild User Cache
Okay, well the rebuilding of the user cache definitely helped, but now I'm getting errors of maybe "duplicated accounts" it seems?

Screen Shot 2015-07-23 at 1.36.23 AM.png

This as well when I try to create a specific user as an administrator:

Screen Shot 2015-07-23 at 1.38.43 AM.png

Thanks.
 

Attachments

Jake Bunce

XenForo moderator
Staff member
#4
Can you help me to understand exactly what happened with your database? I am happy to chase errors, but knowing what happened may help me to get straight to the problem.
 
#5
Nothing happened to the database itself, there was just a user that had administrative privileges on the forums who deleted pretty much all he users except for mine because he did not have the ability. After that all happened, I found out and I went to godaddy getting a SQL user table backup and importing it, that's pretty much it. I doubt anything other than that happened on the site while I was not there.
 

Jake Bunce

XenForo moderator
Staff member
#6
Nothing happened to the database itself, there was just a user that had administrative privileges on the forums who deleted pretty much all he users except for mine because he did not have the ability. After that all happened, I found out and I went to godaddy getting a SQL user table backup and importing it, that's pretty much it. I doubt anything other than that happened on the site while I was not there.
Ok. Doing a manual restore of just xf_user is not sufficient.

Refer to this datawriter:

library/XenForo/DataWriter/User.php

The _getFields function defines the tables and fields for a user. Those tables are:

xf_user
xf_user_authenticate
xf_user_option
xf_user_privacy
xf_user_profile


For a manual restore you would need to restore all 5 of these tables.

Note that you may encounter a period of false associations. For example, if user_id 123 registered and posted some messages and then you restore the user tables back to user_id 120, then when a new user registers and reclaims user_id 123 they will inherit the posts of that old user that was lost. To avoid this problem you can manually set the autoincrement value on the xf_user table after restoring that table.
 
#7
Hmm, is there a way to completely avoid this? Can I just upload a full database backup? But I'm not sure if I have one and if I do, how recent it is. Is it possible that my host would have a pretty recent backup?
 

Divvens

Well-known member
#8
Hmm, is there a way to completely avoid this? Can I just upload a full database backup? But I'm not sure if I have one and if I do, how recent it is. Is it possible that my host would have a pretty recent backup?
You would have to ask them, usually they could have a 1 week backup. Reputed providers do take nightly backups. But that is a question only they will be able to answer, restoring after you get a full backup would be very easy.

Make sure to ask them of a backup of a date before the deleting happened, as they wouldn't know you need a backup with that data (if you ask just for a backup, they may give you a latest one which misses the data you require).