vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need PHP code for exporting *.sql (https://vborg.vbsupport.ru/showthread.php?t=46846)

AZone 12-20-2002 08:32 PM

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!

NTLDR 12-20-2002 09:24 PM

Why not just use the built-in backup script in the ACP?

AZone 12-20-2002 09:30 PM

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?

NTLDR 12-20-2002 09:33 PM

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 :)

AZone 12-20-2002 09:39 PM

I said: I already create this file, I have this file.
I need opposite function! Install *sql file, which already exist!

tHE DSS 12-20-2002 09:40 PM

I see what you need.

You need this :

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

:cool:

... 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.

tHE DSS 12-20-2002 09:45 PM

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. ;)

AZone 12-20-2002 09:49 PM

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!

NTLDR 12-20-2002 09:57 PM

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.

AZone 12-20-2002 09:59 PM

NP

Really? I can install phpMyAdmin myself?


All times are GMT. The time now is 01:50 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.01060 seconds
  • Memory Usage 1,737KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete