Hi all,
In a large database called currentdb there is a table called ibf_posts which is 600MB in size. (for those of you who recognize it, it is the InvisionBoard forum table).
There is a column in ibf_posts called ibf_posts.Post_date and as the name imply it is the posting date.
We want to move all the posts which are older than 21 days to a different REPLICA database called archivedb.
To do that, we first do a
mysqldump -uusername -ppassword currentdb >mydump.txt
We then do:
mysql -uusername -ppassword archivedb < mydump.txt
We now have two identical databases.
We now want to remove everything that is 21 days and older from the currentdb database ibf_posts.Post_date.
THIS IS WHERE I GOT STUCK!
delete from ibf_posts where (Post_date - now()) < 21246060
Is that how this scripts should be written? I think I got my logic here incorrect.
Could use some insight.
Thanks,
-Alon.