Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2008, 04:36 PM
DirtyBirdNJ DirtyBirdNJ is offline
 
Join Date: Nov 2008
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Importing a 400mb .sql file via command line

Hello, I am trying to do a conversion from Groupee/Eve forums to Vbulletin 3.8. I have installed VB, and it is working fine.

My issue has been how to import the data from the other database. I created a .sql backup of the DB, and have downloaded it from the original host (still running) forum and put the .sql backup file on our new development server.

First try, I used SQL Manager Lite... unfortounately their demo version is limited to databases 100mb or smaller. Arg.

Second try, I finally figured out how to access the windows MySQL command line. I ran this command:

mysql eve_import --user=MYUSERNAME --password=MYPASSWORD < D:\eve_backup.sql

This executed, but unfortounately it executed for 5 minutes and reached the server's exeuction time limit. Running the .sql file pinned the CPU and took up about 170mb of memory, I'm glad I'm the only one working on this server!

I don't know if it's possible to specify a timeout limit in the same SQL query you're executing.

Can anybody suggest a way to overcome this?
Reply With Quote
  #2  
Old 12-24-2008, 08:58 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First of all you should not import into 3.8 but 3.7. Unless i missed something ImpEx will only support production versions.

The only reliable method of backing up and restoring a database is with shell access via telnet or ssh. This is because backing up with a PHP script like that in the Admin CP or phpMyAdmin can result in PHP timeouts errors and an incomplete backup file. Please see the instructions here:

Backup:
http://www.vbulletin.com/docs/html/m...nce_ssh_backup

Restore:
http://www.vbulletin.com/docs/html/m...ce_ssh_restore

P.S. If you don't have shell access, some people have also reported success with these scripts:

MySQLDumper:
http://www.mysqldumper.de/en/index.php

MySQLHotxcopy:
http://www.vbulletin.com/forum/showt...t=mysqlhotcopy

Bigdump:
http://www.ozerov.de/bigdump.php

PS Increasing the limits in your SQL config might also be needed.
Reply With Quote
  #3  
Old 12-24-2008, 03:34 PM
DirtyBirdNJ DirtyBirdNJ is offline
 
Join Date: Nov 2008
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for those suggestions Marco.

I would love to change the mysql config file, but I don't know where it is. I am using a Windows 2003 Server and MySQL 4.1. I also scared the pants off myself, I did not install 3.8, I have 3.7.4 set up.

One of my friends suggested writing a .php file that would:

1. call a function to set the timeout to unlimited
2. execute a shell command to do the database import
3. call a function to set the timeout back to 300 seconds

It sounds like some of those scripts you referenced will do the trick. I have this habit where I like to read the code of scripts before I run them, so now I have some fun work stuff to do over the holidays... woo

Happy Holidays!
Reply With Quote
  #4  
Old 12-25-2008, 05:34 AM
vbplusme vbplusme is offline
 
Join Date: Sep 2008
Location: CyberSpace
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

IMHO, use the wheel that has already been created and working with success. Hacking to change php will cause you are lot more headaches that its worth. I often use the shell to import database with great success though I do use tools like bigdump that has been mentioned as well. With a 400 meg database, I think you would be wise to stick with "known" solutions rather than trying to use or develop hacks that will shoot you in the head and cause a lot of pain before you finish the job and then you end up with an "unknown" state that is nearly impossible to troubleshoot.

HTH
Reply With Quote
  #5  
Old 12-27-2008, 01:32 PM
DirtyBirdNJ DirtyBirdNJ is offline
 
Join Date: Nov 2008
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the reply vbplusme.

The problem is there is no "known" way to do this, at least for me. The pieces of software linked to above are ok, but one needs perl... and the last thing I want to do is mess with my environment by installing new languages.

Using PHP to modify settings during the execution of a script might work- but I agree with you. Introducing PHP into the mix only further confuses things, it's one more variable in the equation.

Ok so now the question is how to modify the MySQL conf file.

Where is that file?

SO...here's what I think I need to do now.

1. Change the execution timeout from 300(seconds) to 0(unlimited)
2. Run the import straight from the mysql cmd line interpreter
3. Change the execution timeout back to 300(seconds).

Thoughts?
Reply With Quote
  #6  
Old 12-27-2008, 02:04 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On a typical linux configuration the MySL config file will be /etc/my.cnf
Reply With Quote
  #7  
Old 12-30-2008, 02:02 PM
DirtyBirdNJ DirtyBirdNJ is offline
 
Join Date: Nov 2008
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the suggestion Marco. Unfortunately, I'm stuck with a windows 2003 server. On one hand I would prefer linux, but I am not a server admin and having somebody who can set the environment up for me (and fix things when I break them) is worth it.

I found the mysql config file, my.ini, in Program Files\MySQL\MySQL Server 4.1\

I can't find the line/entry that specifies the timeout in my.ini. I've been googling, searching MySQL's 4.1 documentation... and I can't find anything on how to modify the execution timeout. The only links I find are people (trying) to modify it via PHP... which is NOT what I want to do.

There are several other .ini files in the directory where my.ini is, and they are labled things like my-large.ini, my-small.ini... etc.

None of these files have any mention of the word "timeout", "time out", "time_out" or the value 300 (what the timeout is set to, as mentioned in the error message I get) do not appear anywhere in these files.

WHERE IS THIS #$*#&@! SETTING?!?!?
Reply With Quote
  #8  
Old 12-30-2008, 02:38 PM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DirtyBirdNJ View Post
Thanks for the suggestion Marco. Unfortunately, I'm stuck with a windows 2003 server. On one hand I would prefer linux, but I am not a server admin and having somebody who can set the environment up for me (and fix things when I break them) is worth it.

I found the mysql config file, my.ini, in Program Files\MySQL\MySQL Server 4.1\

I can't find the line/entry that specifies the timeout in my.ini. I've been googling, searching MySQL's 4.1 documentation... and I can't find anything on how to modify the execution timeout. The only links I find are people (trying) to modify it via PHP... which is NOT what I want to do.

There are several other .ini files in the directory where my.ini is, and they are labled things like my-large.ini, my-small.ini... etc.

None of these files have any mention of the word "timeout", "time out", "time_out" or the value 300 (what the timeout is set to, as mentioned in the error message I get) do not appear anywhere in these files.

WHERE IS THIS #$*#&@! SETTING?!?!?

If the setting isn't in your my.cnf file you can add it yourself. I'm not real familar with the MySQL for windows or if the configuration format is different, but you usually just have to add to your my.cnf

wait_timeout = 90
connect_timeout = 10

Then modify the times accordingly
Reply With Quote
  #9  
Old 12-30-2008, 03:55 PM
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try using your mysql import from the console type IMPORT FILE INTO yourtable c:\your\files\location\and\extension.sqli; in the comand console to import the sql.

or try this one

mysql -u username -p database /path/to/file/textfile.sql

that way your database does all the work
Reply With Quote
  #10  
Old 12-30-2008, 05:24 PM
DirtyBirdNJ DirtyBirdNJ is offline
 
Join Date: Nov 2008
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the suggestion pein87.

I tried what you suggested, and that's how I got to my execution time-limit hurdle.

FRDS, thanks very much. Do you know if those lines have to go anywhere specific in the my.ini/cnf file?

Can I just put them as the last two lines of the file, and then delete them and restart the MySQL service again after I've done the import?
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 02:40 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.07563 seconds
  • Memory Usage 2,261KB
  • 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)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete