The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello!
A moderator in my forum has deleted like 40,000 users from the DB. Now i have a backup but in difference of times between the backup and the deletion, lot a new members registered. I only want to copy the users from one old user table in the old DB to the new user table in the new DB, but if the userid already exists, dont copy the row and continue to the next row. What is the SQL command for that? Thanks in advance. |
#2
|
|||
|
|||
![]()
You can not restore just 1 table, they are all linked together.
|
#3
|
|||
|
|||
![]()
I'm not talking about restore, i'm talking about using a query, select the data from user1 and copy it to user2.
And if i can't do that, so what other solution do you offer? |
#4
|
|||
|
|||
![]()
That would be a partial restore of a single table. This will not work.
My best suggestion is to simply restore the database and take the loss of new posts. Alternative would be to restore to a temporary database, clean the temp. forum from all other users/posts/etc.. then use ImpEx to merge. |
#5
|
|||
|
|||
![]()
I dont need to use the impex.
I dont really care about those 40,000 users, only for their email address and the forum stats, not about their posts and etc. I can use the query INSERT ... SELECT, but i don't know how to use the ON DUPLICATE KEY, i want it to do nothing if the key already exists. Can you please add more light on this query? Is it possible that the query should be: Code:
INSERT IGNORE INTO `user` (userid, username, ...) SELECT * FROM `user_backup`; |
#6
|
||||
|
||||
![]()
yes, though you would be better explicitly naming the backup fields
[sql] INSERT IGNORE INTO `user` (userid, username, ...) SELECT userid,username... FROM `user_backup`; [/sql] |
#7
|
|||
|
|||
![]()
You should not restore (data from) single tables, this will most likely break your board!!
|
#8
|
||||
|
||||
![]()
Roman Law Marco. It's his to break
![]() |
#9
|
|||
|
|||
![]()
It didn't break my board, i backed up everything first, and it worked fine, Thanks Eikinskjaldi!
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|