How to remove old admin users?

Started by whosaidthat, February 11, 2010, 12:03:38 PM

Previous topic - Next topic

whosaidthat

I have recently moved my forum from 1 host to another.

The problem I am having is that I need to change the main admin user as they have now changed. I have gone through all of the permissions and changed their permissions but all this has done is generate errors.

Is there a way to change the main person listed as admin #1 so they are made a normal user and replace them with who is now the main administrator.

All I seem to have been able to do at the moment is just change the permissions for them, but it seems that some of the changes they made on the old database has caused problems and this as been transferred to the newly hosted database when I restored from the backup.

I am using SMF 2.0 RC2

adbrad

from the new admin account go in to the old admin accounts profile
go to action and delete the account.
anyone with in the administrator group will be granted all permissions

Matthew K.

If you want someone to be user_id #1, you can always edit the database using phpMyAdmin and make it reflect your goal.

whosaidthat

Quote from: adbrad on February 11, 2010, 12:22:24 PM
from the new admin account go in to the old admin accounts profile
go to action and delete the account.
anyone with in the administrator group will be granted all permissions

But I don't want to delete them as they are still and active user.

Quote from: Labradoodle-360 on February 11, 2010, 12:24:56 PM
If you want someone to be user_id #1, you can always edit the database using phpMyAdmin and make it reflect your goal.

How would I go about changing the user_id #1 in phpMyAdmin is there something I need to be looking for in order to change this?

Matthew K.

phpMyAdmin > {db_prefix}members > Click the pencil next to the member with "id_member 1".
Change the id_member from 1, to the next number not used on your forum. (If you have 50 users, put it as 51).

Then, edit your user in phpMyAdmin and change your id_member, to 1.
Here is a screenshot of the first 3 steps.


Labradoodle-360

adbrad

Quote from: smartmart on February 11, 2010, 12:31:10 PM
Quote from: adbrad on February 11, 2010, 12:22:24 PM
from the new admin account go in to the old admin accounts profile
go to action and delete the account.
anyone with in the administrator group will be granted all permissions

But I don't want to delete them as they are still and active user.

Quote from: Labradoodle-360 on February 11, 2010, 12:24:56 PM
If you want someone to be user_id #1, you can always edit the database using phpMyAdmin and make it reflect your goal.

How would I go about changing the user_id #1 in phpMyAdmin is there something I need to be looking for in order to change this?

ok then you could go in to there profile and change there member group to regular member unless you still need them to preform admin duties.

Matthew K.

Exactly, my instructions change them from user_id #1 (which is NORMALLY the owner of the website) to the latest member (on a scale wise), and then by going to their profile you can change their actual membergroup/permissions.

whosaidthat

Thanks guys you been great.

I got one more question though, when I swap the ID No's it changes also who made the post under that ID also.

Is there a way you can move the posts to the original ID or is this asking to much?

Matthew K.

You could do a database query that would find all values of member_id 1, and replace it with that members new idea, and vise versa for you.

whosaidthat

Quote from: Labradoodle-360 on February 11, 2010, 02:40:23 PM
You could do a database query that would find all values of member_id 1, and replace it with that members new idea, and vise versa for you.

I'm not sure how to do that. I can get around somthings but this is one area I'm not very good with. I'm quessing you mean a swap of information if so how would I carry this out.

Sorry if this is a really simple question.

Matthew K.

#10
Go to: phpMyAdmin > Forum Database > Click the Query Tab

This is the query to run:SELECT REPLACE(id_member, '1', 'NEW NUMBER') from {db_prefix}_messages;

You'll need to alter "NEW NUMBER" to the new number of the member. And change {db_prefix} to your prefix (is smf_ by default).

After you run this query, and make the changes, you'll need to run a few more to change all information from that user.

whosaidthat

Thanks for you help Labradoodle-360

I'm quessing I will need to run

{smf_}_messages;
{smf_}_posts;

etc

Matthew K.

I have PM'd you a couple more queries to cover those area's, I am also writing up another, to cover all of the remaining tables (including logs).

Labradoodle-360

whosaidthat

#13
I would just like to say a big thank you to Labradoodle-360 your help has been amazing.

whosaidthat

Quote from: Labradoodle-360 on February 11, 2010, 03:28:13 PM
I have PM'd you a couple more queries to cover those area's, I am also writing up another, to cover all of the remaining tables (including logs).

Labradoodle-360

I have now run all the query as listed in my PM, however when I check the forum there does not appear to have been any change all post etc are still register under the same user

Matthew K.

Make sure the value's are changing in the database. If they are, make sure you clear your cache and forums cache.

whosaidthat

How would I know if the values have changed? It appears to do something when I click go but not sure what you mean

Matthew K.

Once you run the query you'll see something like:


Make sure you click that, for each query or it won't replace the value's.

whosaidthat

I have followed all the instructions 2 the letter yet it seems to not have made any change.

The use ID 1 still holds all of the post message etc and yet the new user id display no posts or messages. However when I look at the new user id profile it says that they have made post but no post or topics are listed.

Have I done something wrong?

Matthew K.

What is the exact query you ran to change the id_member from smf_members?

With your data filled in...
Labradoodle-360

whosaidthat

Quote from: Labradoodle-360 on February 12, 2010, 11:01:12 AM
What is the exact query you ran to change the id_member from smf_members?

With your data filled in...
Labradoodle-360

Quote from: Labradoodle-360 on February 11, 2010, 12:36:37 PM
phpMyAdmin > {db_prefix}members > Click the pencil next to the member with "id_member 1".
Change the id_member from 1, to the next number not used on your forum. (If you have 50 users, put it as 51).

Then, edit your user in phpMyAdmin and change your id_member, to 1.
Here is a screenshot of the first 3 steps.


Labradoodle-360

I did'nt run a query for this, I just changed the ID numbers around within the members details in PHPMYADMIN as shown above. should I have actually run a query to swap them over?

Advertisement: