Forum Moderators: open
I have a very busy ecommerce site that uses Redhat, php, and mysql. We have one database where transactions are stored and our customer service reps access to perform their work.
I would like to keep the original database for the ecommerce side and then use a second database that contains the exact data for the customer service reps to work in. This way if they delete a customer record or somehow screw up a record I can always restore from the original ecommerce record.
I'm thinking of setting up the second database and then using the binary logs from the original database to update the second database several times per day. The reps do not need real time updates so several times per day would be fine.
Is this the best way of doing this? If so, does anyone know of any scripts that are already written that will update a db from the binary logs?
I looked at replication but I'm not sure that's the way to go.
John
On production server:
1)
mysqldump --opt yourdb -uusername -ppassword > yourdb.sql
2)
Set up an ssh client key so you can ssh between servers non-interactively, see:
[hacks.oreilly.com...]
rsync -ave ssh yourdb.sql you@remoteserver.com:./
On remote server:
3)
mysql -uusername -ppass < yourdb.sql
ssh example.com "mysql -uusername -ppass < yourdb.sql"
This is mostly from memory but I just want to get the idea across. I recommend the book Linux Server Hacks (see the link above) for more info on these tools.