vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   .::Backup DB on Server (Selective Tables) ::. (https://vborg.vbsupport.ru/showthread.php?t=41790)

Kumaro 08-01-2002 07:49 PM

.::Backup DB on Server (Selective Tables) ::.
 
Problem:
The database of my forums is well over 900MB in size after saving it to my server. This is mainly because of my search index which is basically useless to save since it can be rebuilt. In fact, due to this gigantic DB, I can't even backup anymore because the backup script takes so long that it times out.

Solution:
I noticed that it is possible to backup without certain tables of choise, however I need to keep the backups on the server.

I was hoping somebody could make a hack that allows me to backup the database on the server and be able to deselect the tables I don't want to include.

I think this would benefit many sites with large traffic and databases. Thanks

Xenon 08-01-2002 08:00 PM

the backupfeature of vb can do that as i know...

Kumaro 08-02-2002 02:23 AM

no, i don't think you read this properly. You can select what tables to include and not include, but thats only if you are downloading the backup. i want to be able to select what tables to include and not include when saving the backup directly on the server.

Xenon 08-02-2002 10:25 AM

yes sorry was my fault...

hmm, i think you can try this:

open admin/backup.php

find:
PHP Code:

doformheader("backup","sqlfile");
  
maketableheader("Save data to file on server:"); 

below add:
PHP Code:

$result=$DB_site->query("SHOW tables");
  while (
$currow=$DB_site->fetch_array($result)) {
    
makeyesnocode($currow[0],"table[$currow[0]]",1);
  } 

then find this:
PHP Code:

  while ($currow=$DB_site->fetch_array($result)) {
        
sqldumptable($currow[0], $filehandle);
        
fwrite($filehandle"\n\n\n");
        echo 
"<p>Dumping $currow[0]</p>";
  } 

and change it to:
PHP Code:

 while (list($key,$val)=each($table)) {
        if (
$val==1) {
          
sqldumptable($key,$filehandle);
          
fwrite($filehandle"\n\n\n");
                                  echo 
"<p>Dumping $currow[0]</p>";

        }


it should work, because it's the same code used for save to disk ;)

Kumaro 08-04-2002 09:24 PM

i'll try this...i hope it worx...thanks!

Kumaro 08-04-2002 09:29 PM

hmm...
i get this when i access the backup file

Parse error: parse error in /usr/local/psa/home/vhosts/411hype.com/httpdocs/forums/admin/backup.php on line 279

Xenon 08-04-2002 09:32 PM

what is line 279 would help ;)

also i've added a } to my post above, seems i have forgotten it ;)

Kumaro 08-04-2002 09:47 PM

this is really weird...line 256 is the blank line between these codes

PHP Code:

  makeinputcode("separator","separator",",");
  
makeinputcode("Quotes","quotes","'");
  
makeyesnocode("Show column names","showhead",1);

  
doformfooter("Generate");




Kumaro 08-04-2002 09:57 PM

wait...after that little bracket, it seems to be workin...

Kumaro 08-04-2002 10:03 PM

okay...now i can get on the backup page, but after entering the path to where i want to save it, and then press "Save File", i get these two errors:

Warning: 6 is not a valid File-Handle resource in /usr/local/psa/home/vhosts/411hype.com/httpdocs/forums/admin/backup.php on line 88

Warning: 6 is not a valid File-Handle resource in /usr/local/psa/home/vhosts/411hype.com/httpdocs/forums/admin/backup.php on line 119


All times are GMT. The time now is 10:03 AM.

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.00999 seconds
  • Memory Usage 1,743KB
  • 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
  • (5)bbcode_php_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