Incremental MySql Backup

Apr 14, 2009

Does anyone have experience in backing up mysql incrementally? From what I've read in the docs it's possible using the binary logs but I haven't been able to find a good resource on how to make this work.

I have a database that is over 5GB. There are a few Myisam tables that are insert/select only and one innodb table that receives updates/deletes/selects/inserts.

Ideally I wouldn't have to backup the 5GB every night, I'd prefer to only get the items that have changed. If I could make this work, then I could also get backups more often rather than once a night.

View 6 Replies


ADVERTISEMENT

Rsyn --backup --backup-dir Switches For Incremental Backs

Jan 26, 2007

I current do some rsync backups with a command like so every day

rsync -az -e ssh --stats --delete --exclude "stuff" / user@server:/home/user/

What I want to do is have some incremental backups in there in subdirectories. So, for example, something like this on the remote server
/home/user/something.tuesday
/home/user/something.friday

I thought the --backup --backup-dir Switches were used to store just the files that had changed in seperate directories, am I wrong on that?

I've read everything I could find, including the big rsnapshot scripts, but I'm not able to do what I want, it seems so simple but something's not right, am I wrong that subdirs should have just files that are new or have changed. I tried various things like this, but had no luck

rsync -az -e ssh --stats --delete --backup --backup-dir=/home.Thursday --exclude "stuff" / user@server:/home/user/

View 0 Replies View Related

Cpanel Backup, To Incremental Or Not

May 10, 2007

I was wondering if I would be better to use incremental backup in cpanel instead of disabling the incremental feature and having tar.gz backup.

Im doing ssh overnigth on an offsite server.

Gzip is -rsync tagged when activated, as per this ccron command:

Quote:

0 1 * * * export GZIP="--rsyncable" ; /scripts/cpbackup

so they should be rsync friendly?

Whats your tougth on this?

View 11 Replies View Related

Cpanel Incremental Backup

Nov 20, 2007

do incremental backup on my local hard disk but i would use backup compression, is there any way to tar each account and use incremental system? i have read something on GZIP --rsyncable

View 1 Replies View Related

Backup Type :: Daily, Nightly, Incremental?

May 13, 2008

What type of backup do you use with your host? (daily, nightly, incremental, etc)

View 10 Replies View Related

Incremental Backup Of CPanel Accounts To A Remote Server

Oct 10, 2007

I want to back-up accounts managed by cPanel/WebHostManager to a remote server. I want to be able to restore to any of the last 7 days. I believe doing an incremental back-up each night can accomplish this best, saving both bandwidth and disk space on the remote server.

Using the back-up functionality built into WHM is appealing because WHM knows what files need to be backed up to do a full restore. However, WHM can't do exactly what I'm looking for either. I've been looking into using rsync as described in this document:

[url]

It looks becaue of the "hard link" capabilities of linux, rsync can be used to create what functions like a full back-up every night but requires a full backup the first day and then each day after that only the incremental changes have to be transfered. However, because I don't know what directories need to be backed up, I'm not sure how to implement an rsyc solution either. (BTW, I want to back-up everything necessary to be able to restore each account except the log files. So, that means MySQL, mail, config info, and whatever the user has uploaded)

View 1 Replies View Related

I Moved Mysql From /var To /backup/mysql, Mysql Is No Longer Working

May 8, 2009

Since my /var partition is full, so I moved /var/lib/mysql to /backup/mysql/.

Seems all the files are copied and I changed my.cnf reboot mysql, but all the web sites using db is not working anymore..

View 4 Replies View Related

Incremental Rsync

Jan 17, 2008

I have two folders:

/misc
/misc-backup

how do I go about making /misc-backup a mirror of /misc correctly?

View 14 Replies View Related

Incremental Vs Compressed Cpbackup Restore

Jul 8, 2007

I was wondering which of the backup method has the fastest restoration time - is it incremental uncompressed backup or compressed backup?

I am making 2 daily backup which is both uncompressed and compressed. However in case my server broke down, I want to choose which one is the fastest?

View 11 Replies View Related

Restoring Incremental CPanel Backups To A New Drive

Jun 19, 2009

We have incremental backups running in our server. We want to move the cPanel accounts to a new cPanel server and restore in that server. The Backup Restore option in WHM will recognize only compressed backups (like .tar.gz) when it is placed in the /home directory. So how do I do about restoring a incremental backup through the WHM of the new server?

View 4 Replies View Related

How To Fix Mysql Backup

May 25, 2009

I have some NAS storage to do backups to with my dedicated hosting provider. I setup automatic daily backups with WHM to backup the databases and accounts. The server is hosting one site. When it does the backup, it does a mysql dump, and essentially takes the site down for the whole time it is doing the backup because nobody can connect to the database while the dump is happening. Is there a better way to do the backup so that this won't happen, whether it be a different method of backing up to NAS, or just not using NAS at all and using some other method.

View 3 Replies View Related

MYSql Backup From V5 To V4

Jan 19, 2007

I am trying to backup and restore a database and seem to be running in to the following errors.

ERROR 1005 (HY000) at line 29: Can't create table './tcadmin/tc_bandwidth_type.frm' (errno: 121)

Source machine
Windows Server 2003
mysql 5.0.11

destination machine
RHEL 4.x
MYsql 4.1.20

I think it is the way I am backing up the database that is the real problem

I have checked the compatibility mode option in the administration panel for backup, run full backup, and lockled the tables and still I get the error.

I have done some research and I think there is a command line I need to run to make it compatible with mysql 4.x systems but nothing seems to be right that I am doing. Can anyone here offer some insight to what the problem might be?

View 4 Replies View Related

MySQL Backup - How Do You Do It Right

Jun 28, 2007

today when the indata1 file got corrupted and I found out that rsync was NOT backing it up. I had thought the rsyncing the life files was good enough and that if I had to restore I could just run mysqlrepair and get everything back.

what is the RIGHT way to backup MySQL databases and do I want to somehow get rid of the inoddb stuff?

View 14 Replies View Related

Backup MySQL Intensive VPS

Jun 12, 2009

I have two VPS's which run a single MySQL intensive site. The first VPS runs cPanel and has about 50 databases, 200mb each. Second has another 30 databases, of the same size.

What would be the best method to backup this website daily?

At Current;
I use automysqlbackup to backup all the databases at midnight (this crashes the VPS's for about 10 minutes each night). This dumps each one into a zipped file.

Then the rsync copies the changed files (forum attachmenets, cpanel changes etc(whole server)) to an off site location.

Are there any easier ways to do this? The databases are most important!

View 1 Replies View Related

Backup In CPanel/WHM Without Mysql

Apr 14, 2009

The automatic backups you can setup in cpanel/whm bundle the entire user account. Is it possible for it to save everything except the mysql databases?

I have an account that has databases over 5GB+ and would like to handle backing those up separately.

View 6 Replies View Related

Mysql Backup, 2 Different Sizes Why

Jan 18, 2008

Using Cpanel:

-I went to backup option and downloaded the database backup. 951kb

-I went into phpadmin and checked addrop table. 1.5m

Using SSH:
command mysqldump -u myusername_usernam -pmypassword myusername_name > /home/name/backupz/name.sql = 949k

3 different sizes, I would figure maybe adding droptables would amount to higher size but the first way and third way i use, how come there is a size difference of 2kb?

Which is the right way to backup mysql database safely?

View 6 Replies View Related

MYSQL Backup Simple

Aug 20, 2007

Any of you know any good mysql backup software that does all the packages for you? meaning, backup the whole shabang with only ssh access? users,dbs, etc? and probably restore it too?

View 6 Replies View Related

Backup MySQL Databases On PC

Jul 20, 2007

I host with hostgator and I was wondering if there are any software programs or services, or even something in my cpanel that can automatically grab my MySQL databases and everything on my server and make a backup on my personal PC?

I know I can manually do this, but I would like something that automatically does it once a week or something to insure my clients data is always backed up.

View 2 Replies View Related

Is There A Way To Backup MySQL Under These Conditions

Sep 26, 2007

I only have FTP access to webhost and no webhost cpanel access nor shell access. Is there a way to backup the MySQL database that is being used for ZenCart on this host?

I'm thinking that the answer to this question is "no". However, it would be wonderful if someone told me "yes".

View 2 Replies View Related

Backup BIG MySQL Database

Nov 29, 2007

What is the recommended method of backing up big MySQL database of size 2 GB ?

Quote:

# mysqldump gallery > gallery.sql
mysqldump: Got error: 1017: Can't find file: './gallery/10tir_user_group.frm' (errno: 24) when using LOCK TABLES
#

I checked the table, it is fine, but can't do the backup.

Quote:

mysql> check table 10tir_user_group;
+-------------------------+-------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-------------------------+-------+----------+----------+
| gallery.10tir_user_group | check | status | OK |
+-------------------------+-------+----------+----------+
1 row in set (0.07 sec)

mysql>

View 13 Replies View Related

Host That Allows MySQL Backup/restore Via FTP

Sep 24, 2009

I need to get the h3ll away from Godaddy, fast!

However, my site has a large MySQL database (200 megabytes) and it's impossible to backup or restore via phpMyadmin. Godaddy has a feature on their control panel, where you can restore/backup your MySQL database to a special diretory on your web http file space, which you can upload/download vis FTP. I use this alot.

Is there any other web hosting company that offers such a feature? I haven't seen this anywhere except on Godaddy.

As to why I need to get away from Godaddy:

Basically what they did was, my site was getting too much traffic (even though it's still well under Godaddy's advertised limits for that plan)... so they sent me an email that says:

"Your site is using too much server resources. We have moved you to a new server to protect our other customers. Please identify steps to reduce your site traffic and contact us."

They moved my site to what is, apparently, a punishment area (Godaddy Hell) where all the high volume sites go. It is so extremely slow, my site might as well not exist... it is inaccessible to my visitors for all intents and purposes.

View 8 Replies View Related

Secure MySQL Backup Script

Jul 29, 2008

Is there a method of running a back-up script,as root, using MySQL, without passing or storing the root password in the clear?

I have tried OpenSSH with a nologin option using certificates, but I still have problems. I need to run it as a cron job every so often, (without specifics) securely.

I understand I can use another user, other than root, with read-only, but I need to back up the whole db at once, not specific users db's.

View 2 Replies View Related

Backup And Restore Mysql Databases

May 10, 2008

I have a corrupted VPS, and have some mysql databases on it.

I want to backup databases and restore them on the new server.

Cpanel service is down on the vps and I cannot transfer accts.

Is it possible to do so ?

1- Zip or Tar the username folder in /home dir.

2- zip or tar the database name in /var/lib/mysql folder

Either by SSH or File manager trough HyperVM

Then transfer files some where safe...

When vps is rebuilt, restore the archives and databases to
the folders I have backed up before rebuilt.

There are also some accounts on a terminated vps that there is only an image of the vps available so, I only can tar files using a jailed shell account, move to the new vps and untar them.

how to do it and avoid database problems.

View 0 Replies View Related

MySQL Backup Multiple Databases

Feb 8, 2008

My site is databases driven and runs on around 15 mySQL databases. Im wanting to download a local copy of these databases daily, however, if i try and back them up via cPanel (on a WHM VPS) they give me blank files. Each databases is around 55mb and growing. I can back them up one by one via phpmyadmin, it just takes around 5 minutes per database. Meaning around 40 minutes per night..

Is there any solution for having a script downloading them automatically so i can download them via ftp? I've tried [url].htm but it gives me blank files.

View 10 Replies View Related

Backup Mysql User Privileges

Aug 26, 2007

how do i backup mysql user privileges?

this will only backup the databases:
mysqldump --opt -u root -p --all-databases > data.sql

i would like to backup mysql user privileges too.

View 1 Replies View Related

Backup MySQL Databases By Cron

Apr 1, 2007

how to backup MySQL databases by cron and have the backups sent to you by email, or have them uploaded by FTP. It is based on a script I found at another website though I can confirm it is fully working.

Change the commented variables in the following file and save it as backup.sh:

Code:
#!/bin/sh

# This script will backup one or more mySQL databases
# and then optionally email them and/or FTP them

# This script will create a different backup file for each database by day of the week
# i.e. 1-dbname1.sql.gz for database=dbname1 on Monday (day=1)
# This is a trick so that you never have more than 7 days worth of backups on your FTP server.
# as the weeks rotate, the files from the same day of the prev week are overwritten.
#/bin/sh /home/user/directory/scriptname.sh > /dev/null
############################################################
#===> site-specific variables - customize for your site

# List all of the MySQL databases that you want to backup in here,
# each seperated by a space
# If not run by root, only one db per script instance
databases="mydbname"

# Directory where you want the backup files to be placed
backupdir=/home/mydomain/backups

# MySQL dump command, use the full path name here
mysqldumpcmd=/usr/bin/mysqldump

# MySQL Username and password
userpassword=" --user=myuser --password=mypasswd"

# MySQL dump options
dumpoptions=" --quick --add-drop-table --add-locks --extended-insert --lock-tables"

# Unix Commands
gzip=/bin/gzip
uuencode=/usr/bin/uuencode
mail=/bin/mail

# Send Backup? Would you like the backup emailed to you?
# Set to "y" if you do
sendbackup="n"
subject="mySQL Backup"
mailto="me@mydomain.com"

#===> site-specific variables for FTP
ftpbackup="y"
ftpserver="myftpserver.com"
ftpuser="myftpuser"
ftppasswd="myftppasswd"
# If you are keeping the backups in a subdir to your FTP root
ftpdir="forums"

#===> END site-specific variables - customize for your site
############################################################

# Get the Day of the Week (0-6)
# This allows to save one backup for each day of the week
# Just alter the date command if you want to use a timestamp
DOW=`date +%w`

# Create our backup directory if not already there
mkdir -p ${backupdir}
if [ ! -d ${backupdir} ]
then
echo "Not a directory: ${backupdir}"
exit 1
fi

# Dump all of our databases
echo "Dumping MySQL Databases"
for database in $databases
do
$mysqldumpcmd $userpassword $dumpoptions $database > ${backupdir}/${DOW}-${database}.sql
done

# Compress all of our backup files
echo "Compressing Dump Files"
for database in $databases
do
rm -f ${backupdir}/${DOW}-${database}.sql.gz
$gzip ${backupdir}/${DOW}-${database}.sql
done

# Send the backups via email
if [ $sendbackup = "y" ]
then
for database in $databases
do
$uuencode ${backupdir}/${DOW}-${database}.sql.gz > ${backupdir}/${database}.sql.gz.uu
$mail -s "$subject : $database" $mailto < ${backupdir}/${DOW}-${database}.sql.gz.uu
done
fi

# FTP it to the off-site server
echo "FTP file to $ftpserver FTP server"
if [ $ftpbackup = "y" ]
then
for database in $databases
do
echo "==> ${backupdir}/${DOW}-${database}.sql.gz"
ftp -n $ftpserver <<EOF
user $ftpuser $ftppasswd
bin
prompt
cd $ftpdir
lcd ${backupdir}
put ${DOW}-${database}.sql.gz
quit
EOF
done
fi

# And we're done
ls -l ${backupdir}
echo "Dump Complete!"
exit
Upload backup.sh to your server, to any directory you want. A directory which is not web-accessible will stop your login information being seen by just anyone .

You should chmod the file to 777:

Code:
chmod 777 backup.sh
If you uploaded this file from a Windows machine you will need to convert the file to Unix format. You should run the following command by SSH in the appropriate directory:

Code:
dos2unix backup.sh
If you don't have dos2unix installed, you can install it using yum if you have that:

Code:
yum install dos2unix
If you don't have yum, get it here.

You may want to test the script at this point to make sure it's doing what you want it to. Change to the appropriate directory and run this command:

Code:
./backup.sh
Once you're happy with it, enter it into the crontab to run daily (or whenever you want). Cron jobs vary a lot depending on the configuration of your system, so check Google for how to do it on your system. The command you will need to run by cron is:

Code:
/path/to/file/backup.sh

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved