vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   SQL Partial Imports - Users (https://vborg.vbsupport.ru/showthread.php?t=303480)

TheAllusionist 10-16-2013 02:55 PM

SQL Partial Imports - Users
 
My sites have really been hit hard this year by hackers and it has really worn me down to a point where I am tired of putting tons of effort into retrieving them back completely to where they were before attacks, but I have a question regarding importing partial SQL files into my vBulletin database.

This last attack was my forums and to get around all the malicious script uploaded into and overwriting my files, I did a fresh install and imported a bit older database that I thought was good. Things aren't bad accept some users had corrupted member information and through repairing the database etc. some are missing. I however have a user only vBulletin export SQL file that I would like to just import into the database, but through MySQL I get errors or time outs. Should be over 25,000 users in the file maybe that is big for uploading into a database, not certain.

The file was an export from MySQL of my user data, so I thought it would import right in, but it isn't seeming to work.

File Imports report:

Quote:

MySQL said: Documentation
#1062 - Duplicate entry '1-28' for key 'PRIMARY'

If I run a Query I get:

Quote:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


So if anyone could help me with suggestion on if this can be done I would appreciate it, I am an architect not a server or database expert. I am just trying to get things working and house keeping done before everything is moved to a new server I am purchasing.

Thanks in advance for your time and help.

Russell

findingpeace 10-16-2013 04:15 PM

Hi Russel, I think this is because you already have an existing User table, so it isn't importing. My guess would be that you need to first delete/truncate the entire user table, and then import the other one.

Of course, back up before attempting that!

TheAllusionist 10-16-2013 08:37 PM

Thank you, I was hoping there was some syntax I could use to just update missing data. I guess not, thank you for your help.

Regards,

Russell

squidsk 10-18-2013 02:03 AM

Quote:

Originally Posted by TheAllusionist (Post 2453964)
Thank you, I was hoping there was some syntax I could use to just update missing data. I guess not, thank you for your help.

Regards,

Russell

You could but it might be more complicated. You'd need to import the data into a temporary table (i.e. temp_user) and run a query like the following:

Code:

insert into user (select * from temp_user where userid not in (select userid from user));

TheAllusionist 10-21-2013 04:55 PM

squidsk, thank you very much, very helpful!


All times are GMT. The time now is 06:54 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.01000 seconds
  • Memory Usage 1,724KB
  • 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)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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