Incremental backups of a table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cjoly
Forum Newbie
Posts: 1
Joined: Mon Mar 19, 2012 4:14 am

Incremental backups of a table

Post by cjoly »

Greetings from France,

I have a mysql table called 'virtualshowtime' that is updated through a form. I would like to be able to create backups of this table e.g.'virtualshowtime_backup1', 'virtualshowtime_backup2', 'virtualshowtime_backup3', etc. each time the form is submitted and before the 'virtualshowtime' table is updated with data.

Thanks in advance for your help and best regards from Paris,

Christophe
User avatar
mecha_godzilla
Forum Contributor
Posts: 375
Joined: Wed Apr 14, 2010 4:45 pm
Location: UK

Re: Incremental backups of a table

Post by mecha_godzilla »

Hi,

Do you need these backups to be created as MySQL binaries or are you just retrieving records from the the database and saving them as text files? If you want to create MySQL binaries you might need to create a 'trigger' that creates a backup each time a new record is added to the database, but you'll need to make sure this isn't taking too long to run because the backup has to complete before the new record can be added. You also need to consider issues such as record locking (because the backups might become inconsistent if two people are trying to add a new record at roughly the same time) and whether your default MySQL account has the necessary privileges to create backups.

If you need any specific help with MySQL then you might want to post a question in the Databases forum on this site.

HTH,

Mecha Godzilla
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Incremental backups of a table

Post by califdon »

Would you mind explaining why you feel you need to do this? Ordinarily this is not required, which is why I'm asking. You may have a good reason, but knowing what it is would enable us to give you better advice.
User avatar
mecha_godzilla
Forum Contributor
Posts: 375
Joined: Wed Apr 14, 2010 4:45 pm
Location: UK

Re: Incremental backups of a table

Post by mecha_godzilla »

I agree with califdon - I've never heard of a requirement for something like this before because it would be too processor-intensive for big databases, so explaining what you're trying to do would help.

M_G
Post Reply