Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2013, 12:28 AM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default table "user" deleted

My old site's database table "user" has been deleted and I have no database backup, Is it possible to make 1 user and make all the post and threads belong to that user? What's the best thing I could do?
Reply With Quote
  #2  
Old 09-08-2013, 12:41 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You may be able to do the following:
Manually add a new user, then to add the old posts to that user, run this query:

UPDATE post SET userid='xxx' WHERE username='Old Name';


...with 'xxx' being the userid number of the new account and 'Old Name' being the user name on those posts.

After that, rebuild the thread and forum counters in that order:

Admin CP -> Maintenance -> Update Counters
Reply With Quote
  #3  
Old 09-08-2013, 01:24 AM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can i manually create a user?
All my user accounts are gone including admin
Reply With Quote
  #4  
Old 09-08-2013, 01:55 AM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you have access to MyAdminPHP
Reply With Quote
  #5  
Old 09-08-2013, 01:57 AM
chikuru chikuru is offline
 
Join Date: Nov 2011
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes i have phpmyadmin
Reply With Quote
  #6  
Old 09-08-2013, 02:15 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wouldn't change all those usernames and userids in your post table. Your members will be able to re-register with their original names and maybe then you could deal with getting the userids fixed. Maybe you could hire someone to build some queries to fix that. I'm not very good with mysql but I'm sure someone here could figure it out

--------------- Added [DATE]1378611017[/DATE] at [TIME]1378611017[/TIME] ---------------

I think you can get an admin account in phpMyAdmin as follows:

username: whatever you want

userid: 1

usergroupid: 6

password: d8693d143fb9ade715dcca2b1db93d6f

salt: d`5\MJ1;0G2<BRw2]>u1Jqa3B%Gxw0

Then you should be able to log in with the password "hotdog"
Reply With Quote
  #7  
Old 09-08-2013, 03:32 AM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Or register a new account and login to myadminphp and set the user group for it as 6 then find out the id of your user (you dont need to be a admin to find out user id) then add that userid to the config
Reply With Quote
Благодарность от:
nerbert
  #8  
Old 09-08-2013, 04:00 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With that new account ForceHSS suggested change the userid to your old one. If you are the first to register it will be 1 but maybe that's your old userid anyway.

If you can find someone to do the work here's what I think you need:

1. Build a new table called "restore_users" with userid and username fields

2. Query the post table and populate restore_users with usernames and userids from the posts.

3. Get the highest userid from restore_users and create an account with that number + 1 in the user table. I think this will force the next registered user to have a user id one higher than that (max + 2).

4. Create a query against the user table starting with userid = max + 2 that would take a username like JoeBlow_1, query restore_users for JoeBlow get the old userid, then change JoeBlow_1 to JoeBlow and the new userid to the old one from restore_users, then delete JoeBlow from restore_users. You would have to have some page with a button to run this last query and you could run it several times a day as your old users re-register. If I were better at mysql and wasn't busy with other projects I'd do it but like I said before , there are a lot of good coders here you could hire.
Reply With Quote
Благодарность от:
tbworld
  #9  
Old 09-08-2013, 05:15 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@nerbert , @ozzy47, @ForceHSS - Nice of you to take the time and point this gentleman in the right direction.
Reply With Quote
2 благодарности(ей) от:
ForceHSS, ozzy47
  #10  
Old 09-08-2013, 10:19 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah hopefully between all the info he can get it going again.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:13 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04115 seconds
  • Memory Usage 2,252KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete