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-20-2002, 08:32 PM
AZone's Avatar
AZone AZone is offline
 
Join Date: Nov 2002
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need PHP code for exporting *.sql

I have *sql file (back-up of my forum).

Now I need install (export, extract...) it, but my server doesn't have any Web-manager (like phpMyAdmin, nothing at all) and doesn't allow CGI sripts.
Only one way - PHP

I have sample, but it doesn't work:
Code:
<?php
$sqlEx = "sql"; //
$schema = "vbulletin"; //

$sql = explode(";", implode("", file("./".$schema.".".$sqlEx)));
for ($i = 0; $i < count($sql); $i++) mysql_query($sql[$i]) or
die(mysql_error());
?>
I have message - "No Database Selected"

Help me, please!
Reply With Quote
  #2  
Old 12-20-2002, 09:24 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not just use the built-in backup script in the ACP?
Reply With Quote
  #3  
Old 12-20-2002, 09:30 PM
AZone's Avatar
AZone AZone is offline
 
Join Date: Nov 2002
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I saw only import function there, which makes *.sql file. But now I already made *.sql and I need export it to another forum. Is it possible in ACP?
Reply With Quote
  #4  
Old 12-20-2002, 09:33 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes you can create a .sql file to import into another DB: ACP -> Back-up Database and then either the first option, where you download, or the second option where you can save it to the server
Reply With Quote
  #5  
Old 12-20-2002, 09:39 PM
AZone's Avatar
AZone AZone is offline
 
Join Date: Nov 2002
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I said: I already create this file, I have this file.
I need opposite function! Install *sql file, which already exist!
Reply With Quote
  #6  
Old 12-20-2002, 09:40 PM
tHE DSS's Avatar
tHE DSS tHE DSS is offline
 
Join Date: Jun 2002
Location: UK
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see what you need.

You need this :

http://www.scibit.com/Products/Softw...ils/Mascon.htm



... try out the Freeware version... see if you like it... if you do, you'll have to pay for the full version to be able to put your backup databases back.

At only $49, it's a bloody bargain!!!

With that, you wouldn't even need a backup. You could just make a copy from one server, and dump it directly to the other. Sweet as a nut!!

I was pointed to that utility because our forums database got too large for the vB Admin CP to handle, and we don't have Telnet access to our webserver.

With this application, I can manipulate our database fully.... I can even get rid of the potential security problem of using phpMyAdmin from the web server. :devious:

One thing though.... you will need to go through the vB database structure, and change any fields that are set to NOT NULL, to NULL... as some fields in some records will be blank, even though they shouldn't have NULL values.

When importing a database, you'll notice that it will halt part the way through, due to that error cropping up.

You can always go back and set the NULL fields back to NOT NULL when you've properly imported.

That shoud only affect fields that accept alphanumeric data though. Not INTEGER, and such.

Another thing.... DO NOT EVER set the program to CONTINUE ON ERRORS... because it will continue, but you won't have a complete database.

Anyway... that's what you are looking for. I am 100% you will be happy with it. I am.
Reply With Quote
  #7  
Old 12-20-2002, 09:45 PM
tHE DSS's Avatar
tHE DSS tHE DSS is offline
 
Join Date: Jun 2002
Location: UK
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

p.s : you can schedule backups with that application too.

Being able to fully backup, restore.... copy from server to server directly... shedule those operations... etc. etc. etc. etc. etc.

It's a MUST HAVE UTILITY FOR A MySQL Admin.
Reply With Quote
  #8  
Old 12-20-2002, 09:49 PM
AZone's Avatar
AZone AZone is offline
 
Join Date: Nov 2002
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, I don't have $50 for only one operation - I need to do it only once.

I cannot replace forum from localhost to the internet! Help!
Reply With Quote
  #9  
Old 12-20-2002, 09:57 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by AZone
I said: I already create this file, I have this file.
I need opposite function! Install *sql file, which already exist!
Sorry, I miss-read you post, to me Import doesn't suggest a database backup.

Visit sourceforge.net and install phpMyAdmin on your server yourself as your host doesn't provide it.
Reply With Quote
  #10  
Old 12-20-2002, 09:59 PM
AZone's Avatar
AZone AZone is offline
 
Join Date: Nov 2002
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

NP

Really? I can install phpMyAdmin myself?
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 09:41 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04288 seconds
  • Memory Usage 2,251KB
  • 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_code
  • (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