We don't bite newbies here... much | |
PerlMonks |
mirroring mySQL databaseby filmo (Scribe) |
on Dec 06, 2001 at 07:17 UTC ( [id://129843]=perlquestion: print w/replies, xml ) | Need Help?? |
filmo has asked for the wisdom of the Perl Monks concerning the following question:
Okay, our principle database is hosted by our web service company. (Using Perl and mySQL). What I'd like to do is mirror that database to our development environment without having to dump the database from the server and import it to the development environment. Instead, I'd like only that days changes somehow reflected in the development database. Here are the catches. 1) The mySQL database on the live server can only be accessed by the localhost, so I can't simply log in remotely. 2)The local development platform isn't up all the time, or even most of the time, so I can't have the remote Perl scripts simply access the development database as a seperate call on-the-fly 3)I'd like it to update in batches. i.e. have the live database generate a set of the changes as they occur (all the SQL commands) and then send that set of commands to the development server when it is available to perform the mirror. My first inclination is to have it so that every call to the database via DBI is recorded to a file. For example Later that file could be either e-mailed to the development platform or retrieved via FTP when the development platform is available for such activities. The retrieved file would be executed to the development mySQL database, and in theory, a mirror would be created. Thus, the development mySQL database should be up-to-date as of it's last retrieval. I'd be interested in anybody's ideas or suggestions as to how to implement such a system. (or if it's already been done and I'm reinventing the wheel ;) I'm also starting to get my fingers wet with XML, so if somebody has a nifty XML fix for this problem I'd be interested to learn it.
Back to
Seekers of Perl Wisdom
|
|