Reputation: 914
I made a backup of my MySQL DB's a few days ago, its a huge database and will take to long to export everything and re-import everything. As the backup server has everything except data from a few days ago.
Is there a method in which to export ONLY data after a certain date. Or at the very least export everything, but add an option that will tell it "if data exists, ignore it". As the backup server does have new data.
Thanks in advance...
PS: I have PHPMyAdmin available if there's a simpler way using that, but mysqldump is fine.
Upvotes: 0
Views: 7700
Reputation: 54050
if you are using PHPMyAdmin then you can try with this way.
I think you have a column where last_updated_on
field and which is using current timestamp
Now first get the last row from table which is upto specific date
suppose you have 3000 rows. and you want to export all data after Jan-15.
so first run q query where all rows are retrieving upto Jan-15 ( suppose there are 1800 rows). now you get the number of continuous rows upto jan-15, now click on export tab and see there is a line just above Save as file. where u can set from which rows you need to export
(.)Dump [3000] row(s) starting at record # [ 1800 ] ( ) Dump all rows
hope it helps
from here; you can use this way
mysqldump -u user -p --where="date_coumn>=given date" dbname table_name
Upvotes: 2