Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Eagle31 on June 04, 2018, 10:07:07 PM

Title: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Eagle31 on June 04, 2018, 10:07:07 PM
Greetings,  I deleted by mistake another admins account on the forum but not his postings. So me seeing this a couple days later I created another account manually using the same user name and email address and of course it did not change anything as to his prior account postings had him labeled as "Guest" this is SMF version 1.1.21. I had built this forum in 2011 and then left a few months later and have just come back to help them with spam problems and other issues a few days ago. This is a very low traffic board for a club that only has anywhere from a few postings a day to a few a week. Can this be fixed...???  On a side note I DID do a backup before his account was deleted but NOT on the server but on the forum software itself and saved in gzip format with both the Table Structure and Table Data. Can this be fixed...???...If not I am in a lot of trouble...PLEASE HELP.

(EDIT: Lex tampered with the title. )
Title: Re: DELETED A FELLOW ADMIN ACCOUNT ON ACCIDENT CAN THIS BE FIXED ?
Post by: Sir Osis of Liver on June 04, 2018, 10:57:24 PM
There's a maintenance feature in 2.0 that allows you to attribute guest posts made with an email address or username to a new account, don't see it in 1.1.  If you have a good recent database backup from before you deleted the account, you can restore it and forum content will revert to date of backup.

 
Title: Re: DELETED A FELLOW ADMIN ACCOUNT ON ACCIDENT CAN THIS BE FIXED ?
Post by: Aleksi "Lex" Kilpinen on June 04, 2018, 10:58:19 PM
Do you have a way to contact your fellow admin outside the forum?

The easiest way to fix this would be to reattribute the guest posts to a new account, and let them know what happened. PMs, personal settings and other details would be lost forever, but would not require messing around with the backup.
Title: Re: DELETED A FELLOW ADMIN ACCOUNT ON ACCIDENT CAN THIS BE FIXED ?
Post by: Sir Osis of Liver on June 04, 2018, 10:59:18 PM
Is there a way to do that in 1.1?
Title: Re: DELETED A FELLOW ADMIN ACCOUNT ON ACCIDENT CAN THIS BE FIXED ?
Post by: Eagle31 on June 04, 2018, 11:01:25 PM
Do you have a way to contact your fellow admin outside the forum?

The easiest way to fix this would be to reattribute the guest posts to a new account, and let them know what happened. PMs, personal settings and other details would be lost forever, but would not require messing around with the backup.
I just came back to this club and that would create a LOT of drama and that is what I would like to avoid.
Title: Re: DELETED A FELLOW ADMIN ACCOUNT ON ACCIDENT CAN THIS BE FIXED ?
Post by: Aleksi "Lex" Kilpinen on June 04, 2018, 11:02:01 PM
It can be done, there is not a built in tool for it though.
Basically the same method but manually through the database.
Title: Re: DELETED A FELLOW ADMIN ACCOUNT ON ACCIDENT CAN THIS BE FIXED ?
Post by: Aleksi "Lex" Kilpinen on June 04, 2018, 11:04:09 PM
I just came back to this club and that would create a LOT of drama and that is what I would like to avoid.
Then do you have access to the server and database? You would need to be absolutely sure your database backup is complete and functional, but using that is the only option to fully reverse this.
Title: Re: DELETED A FELLOW ADMIN ACCOUNT ON ACCIDENT CAN THIS BE FIXED ?
Post by: Eagle31 on June 04, 2018, 11:08:49 PM
I can GET access but as to the backup file like I said this was done through the forum software not the server.
Title: Re: DELETED A FELLOW ADMIN ACCOUNT ON ACCIDENT CAN THIS BE FIXED ?
Post by: Aleksi "Lex" Kilpinen on June 04, 2018, 11:12:11 PM
How big is the forum, and how large is the backup?
Title: Re: DELETED A FELLOW ADMIN ACCOUNT ON ACCIDENT CAN THIS BE FIXED ?
Post by: Eagle31 on June 04, 2018, 11:25:24 PM
How big is the forum, and how large is the backup?
Like I said above it is a really small board. The backup that I did with the SMF software is less than 2 meg. Super small file.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Aleksi "Lex" Kilpinen on June 04, 2018, 11:29:19 PM
Ok, if you can I would suggest creating a new database and importing the backup in it. Then using repair_settings change the forum to use that new database, keeping the old one as a backup in case the dump wasn't perfect.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Eagle31 on June 04, 2018, 11:36:29 PM
Ok, if you can I would suggest creating a new database and importing the backup in it. Then using repair_settings change the forum to use that new database, keeping the old one as a backup in case the dump wasn't perfect.
I am sorry but I do not know how to do that ?
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Aleksi "Lex" Kilpinen on June 04, 2018, 11:43:41 PM
That would require access to the server, and details would depend on your hosting.

Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Eagle31 on June 04, 2018, 11:55:26 PM
That would require access to the server, and details would depend on your hosting.
Server access I can get. What is the name of the File folder in the SMF installation I would need access to.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Aleksi "Lex" Kilpinen on June 04, 2018, 11:58:00 PM
Not a file in the folder structure usually.
Most commonly the hosting control panel (cPanel or Plesk for example) will have a section for database related things.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Eagle31 on June 05, 2018, 12:15:04 AM
Not a file in the folder structure usually.
Most commonly the hosting control panel (cPanel or Plesk for example) will have a section for database related things.
Ok, Lex, let me look into some things with the server and our Club President and I will back to you on this thread either tomorrow night or the next day. Is that ok ?
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Aleksi "Lex" Kilpinen on June 05, 2018, 12:19:21 AM
Sure, we'll be here :)
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Eagle31 on June 05, 2018, 12:33:52 AM
Sure, we'll be here :)
I have not been into that server in almost seven years. I will have the needed information to do so by tomorrow night. After I get into it and look around a bit I will post up.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Illori on June 05, 2018, 05:08:22 AM
if you did a backup from the admin panel, it is possible it is not a good database backup to use as that function is known to not do a complete database backup.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Aleksi "Lex" Kilpinen on June 05, 2018, 05:23:56 AM
For future reference, and to further clarify for Sir Osis of Liver what I meant.

Reattribute posts:

Code: [Select]

UPDATE {db_prefix}_messages SET ID_MEMBER='THEIR__NEW_ID' WHERE postername='Old_Nickname';


For example, if the guest posts now show "LexArma" and you wish to reattribute them to a new member with the name "LexArma" and ID number 105, the query would be

Code: [Select]

UPDATE smf_messages SET ID_MEMBER='105' WHERE posterName='LexArma';


This would effectivily return all the posts written by anyone using the name LexArma, to be linked with the account ID 105.

This would NOT fix the post count though, and for that you should probably try this mod
Member post recount (http://custom.simplemachines.org/mods/index.php?mod=561) and run maintanence. :)
( The mod is old but may work still, I'm not sure )

Personal Messages (maybe partial):

Code: [Select]
UPDATE {db_prefix}_pm_recipients SET ID_MEMBER = 'NEW ID NUMBER' WHERE ID_MEMBER = 'OLD ID NUMBER'
Code: [Select]
UPDATE {db_prefix}_personal_messages SET ID_MEMBER_FROM = 'NEW ID' WHERE fromName = 'OLD USER NAME'

Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Eagle31 on June 05, 2018, 05:53:55 PM
Reattribute guest user. Where would I do this at ? On the server side or in SMF
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Illori on June 05, 2018, 06:01:40 PM
since you are using SMF 1.1.* you would to do it via queries in phpmyadmin or similar interface to the database.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Eagle31 on June 05, 2018, 06:42:40 PM
Could it be be done more easily if I was to up grade the software ?
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Sir Osis of Liver on June 05, 2018, 06:54:19 PM
That's an interesting idea, can't think of a reason why it wouldn't work.  I'd leave the production forum as is, set up a clone, upgrade to 2.0.15 and try it.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Kindred on June 05, 2018, 06:55:08 PM
yes. it is a standardized function in 2.0.x

besides, 1.1.x is at end of life and you should upgrade anyway for security reasons, if nothing else
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Dav999 on June 06, 2018, 03:28:52 PM
If you want to do this silently (you mentioned avoiding drama) then it might be good to note that creating a new account and re-attributing posts won't go without leaving lots of clues that something was "tampered" with, including the user's password not working anymore, PMs being deleted, IDs being in a strange order, etc. So, restoring the backup would be the cleanest option.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Aleksi "Lex" Kilpinen on June 06, 2018, 03:32:21 PM
Yeah, this would be the safest and cleanest option.
Ok, if you can I would suggest creating a new database and importing the backup in it. Then using repair_settings change the forum to use that new database, keeping the old one as a backup in case the dump wasn't perfect.
To see if everything got imported OK, you probably only need to see if your oldest and latest topics are intact and working correctly.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Eagle31 on June 09, 2018, 01:16:08 AM
If you want to do this silently (you mentioned avoiding drama) then it might be good to note that creating a new account and re-attributing posts won't go without leaving lots of clues that something was "tampered" with, including the user's password not working anymore, PMs being deleted, IDs being in a strange order, etc. So, restoring the backup would be the cleanest option.
IAgree, ok so I  have the backup file and extracted it as it was in GZ format. what extracted was one file that is a SQL file. Is this normal ? If it is where would I go on the server within the SMF installation and overwrite the existing file ? I DO have a test forum with the same version of SMF 1.1.21 to try it out.
Title: Re: Deleted a fellow admin's account on accident, can this be fixed?
Post by: Aleksi "Lex" Kilpinen on June 09, 2018, 01:19:42 AM
Yes, it's normal to be an sql file. You cannot use it within SMF though. You will need to import it to a database.
How do I restore a database backup? (https://wiki.simplemachines.org/smf/How_do_I_restore_the_database_data)