The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Need Advice on an Import Script
I am nearing the completion of a script to import a book reviews database into vbulletin, then manipluate those files with custom files.
Anyway, I need to write an import script that will be making many posts in rapid succession as it adds the rows from the old database to the new. However, I've found the script shuts down after 10-14 posts. Is this a security feature, or do I need to insert some kind of delay loop to protect mysql from flood? I've never done this sort of thing before, so help would be appreciated. |
#2
|
|||
|
|||
How are you making the new posts?
Manual SQL INSERT's? Or are you using some vB functions? |
#3
|
|||
|
|||
here is some idea that poped up in my mind..
read the tables from old db and save them as .sql (php will do that for 2mb per file) now my idea is to read source of phpmyadmin to see how its load .sql files and to load it like phpmyadmin does can be a good way... its just an idea, and its might be a very bad idea but its also might work. |
#4
|
||||
|
||||
I'm letting vbulletin do as much work as possible. I copied the tables from the old database into vbulletin's database temporarily with this query, one at a time.
Code:
create table forums.tablecopyinvbulletin select * from olddatabase.tabletocopy Next I've created the permanent tables for the new structure that my new vbulletin integrated program will use. For instance, the first table is "publishers" The lion's share of information on publishers on their old table is the info field. And they have a name. So I've created a "publisher data thread" and, using the post branch of the newreply.php script as a template, I constructed a while loop to read off one row of the old publisher table at a time, put the title and info into the vbulletin database (specificially the publisher data thread) and then adding some information to the cutom tables using custom queries before starting the loop again. Yes, vbulletin inbuilt functions are being used - specifically all those appearing in that particular program branch - build_new_post key among them. Luckily I have a local copy of vbulletin set aside specifically for this project so I can truncuate the post, thread and postindex tables and start over as necessary. Quote:
|
#5
|
|||
|
|||
so all you need is to match fileds
but you said Quote:
[SQL]create table forums.tablecopyinvbulletin select * from olddatabase.tabletocopy[/SQL] ?? or im confused.. |
#6
|
||||
|
||||
It shuts down after I loop through build... wait. I think I got it.... buh bye
EDIT: Nope.. This is what I have so far... PHP Code:
|
#7
|
|||
|
|||
Yes i think you will have much less trouble if you insert direct into the thread/post table.
|
#8
|
||||
|
||||
Yep - that's what I ended up doing. I'll just have to rebuild the postindex afterward - a macro that can take awhile to run on large boards like EN World though
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|