Dynadot โ€” .com Registration $8.99

Splitting SQL File?

Spacemail by SpaceshipSpacemail by Spaceship
Watch

action012

Established Member
Impact
4
Is there any good why to split up my backup database .sql file into smaller size.

I backup all of my MySQL Databases to .sql files every night. The problem that I currently see is that some of these backup are now becoming large 5 to 10 megs so if I did need to restore them I would not be able to use phpMyAdmin to restore the backup.

Is there an easy way to split these files into a smaller size that would allow me to restore the database back by just uploading several smaller files?

Maybe a low cost program or script?

Thanks for nay help you can provide.

Steve
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
You could always move seperate backups of each table.. (The big ones) and than make another one of the smaller ones.

iNod.
 
0
•••
iNod said:
You could always move seperate backups of each table.. (The big ones) and than make another one of the smaller ones.

iNod.


Thanks, but the script that I'm using to do the auto backups just backup the whole database. That's why I was hoping to find away to just split the backup file.

Thanks,

Steve
 
0
•••
action012 said:
Thanks, but the script that I'm using to do the auto backups just backup the whole database. That's why I was hoping to find away to just split the backup file.

Thanks,

Steve

Well what script as you using? Do you have PHPMyAdmin? If not I would install or put on PHPMyAdmin.

iNod.
 
0
•••
iNod said:
Well what script as you using? Do you have PHPMyAdmin? If not I would install or put on PHPMyAdmin.

iNod.

Yes I have PHPMYADMIN but as far as I known you have to go in and manually do your backups. With the script I currently have it just emails them to my Gmail account once every day, running of a cron job I setup.


Thanks,

Stve
 
0
•••
Hello,

If you post the script or PM me I can make it generate and email you split backups.. OR you can put it into a ZIP or TAR file and greatly reduce the size.

iNod.
 
0
•••
iNod said:
Hello,

If you post the script or PM me I can make it generate and email you split backups.. OR you can put it into a ZIP or TAR file and greatly reduce the size.

iNod.

PHP:
<?php

// Visit DigiWire.org For More Cool Scripts Like This
// Feel free to use this script however you like
// For cPanel Use ONLY !!! You must also be able to set cron jobs in your cPanel

// Email address to send the backups to (recommended to be Gmail) However any account with a high limit of space will do.
// ------------------------------------------------------
$email_address = "[email protected]";

// cPanel authentication information: the username and pass you use to logon to cPanel at your host
// ------------------------------------------------------
$cpanel_username = "database_user_name";
$cpanel_password = "database_password";

// The address of your webhost (or the location of the cPanel)
// ------------------------------------------------------
$host = "hostname.com";

// The database to be backed up... NOT INCLUDING THE ACCOUNT NAME BIT...
// For example...
// 'fayte_forums' would become just 'forums'
// 'dave_mydatabase' would become just 'mydatabase'
// ------------------------------------------------------
$database_name = "mydata";

// All Done -> Now upload this file and make sure it can be excuted, set CMOD to 777 if you wish.
// DO NOT edit below this line

function gmail_send_file($email, $from, $file) {
         $mime_boundary = "gmail" . md5(uniqid(mt_rand(), 1));
         $header  = "From: ".$from."\nMIME-Version: 1.0\nContent-Type: multipart/mixed;\n boundary=\"".$mime_boundary."\"\n";
         $dateandtime = gmdate("d-m-y @ h:i:s A");
         $content  = "--".$mime_boundary."\n";
         $content .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
         $content .= "Content-Transfer-Encoding: 7bit\n\n";
  	 $content .= "The database had been backed up and is ready for download below!\n";
         $content .= "The backup was excuted at: ".$dateandtime." GMT Time\n\n";
         $content .= "--".$mime_boundary."\n";
         $content .= "Content-Disposition: attachment;\n";
         $content .= "Content-Type: Application/Octet-Stream;";
         $content .= " name=\"".basename($file)."\"\n";
         $content .= "Content-Transfer-Encoding: base64\n\n";
         $content .= chunk_split(base64_encode(file_get_contents($file)))."\n";
         $content .= "--".$mime_boundary."\n";
         mail($email, "Repricing Ezlx DB backup", $content, $header);
}

gmail_send_file($email_address, "Backup <DBBackup@".$host."", "http://".$cpanel_username.":".$cpanel_password."@".$host.":2082/getsqlbackup/".$database_name.".gz");

?>

I'm using this script that I believe I found at hotscripts been working good. just need to over come the size problem.

Thanks,


Steve
 
0
•••
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back