vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   table "user" deleted (https://vborg.vbsupport.ru/showthread.php?t=302002)

chikuru 09-07-2013 11:28 PM

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?

ozzy47 09-07-2013 11:41 PM

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

chikuru 09-08-2013 12:24 AM

How can i manually create a user?
All my user accounts are gone including admin

ForceHSS 09-08-2013 12:55 AM

Do you have access to MyAdminPHP

chikuru 09-08-2013 12:57 AM

yes i have phpmyadmin

nerbert 09-08-2013 01:15 AM

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"

ForceHSS 09-08-2013 02:32 AM

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

nerbert 09-08-2013 03:00 AM

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.

tbworld 09-08-2013 04:15 AM

@nerbert , @ozzy47, @ForceHSS - Nice of you to take the time and point this gentleman in the right direction. :)

ozzy47 09-08-2013 09:19 AM

Yeah hopefully between all the info he can get it going again. :)


All times are GMT. The time now is 05:15 AM.

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.01634 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete