in reply to Dumping a Database via DBI
Since you're using MySQL qhy not just use its built-in functions for dumping and loading data? In my experience built-in DB tools such as there are often significantly faster than iterating through a DB by hand for replication (typically 10x faster if not more). mysqldump does a great job of dumping a snapshot of a MySQL DB. It can be configured to dump the schemas along with the contents. mysqlimport can then be used to load the dump file back into another MySQL on another server (after you move the dump file over). At the very least, since your source DB is MySQL you can use mysqldump and load from that dump into the other DB. I've used mysqldump and mysqlimport in conjunction with dumps to/from other DB's (most DB's have similar tools) and had very good success. Both tools are very configurable to handle a variety of common methods of formatting the data. IMHO you should alway's use a DB's native import and export functions, if necessary use a perl program to translate the format if both don't use the same format.
If you are bound-and-determined to do this in perl, you are going to have trouble because there is no standard cross-db way to get a listing of all the tables and to dump their schemas.
|
|---|