I have two mysql databases that have almost the same structure and representing the data of the same web app but one of them represents the current version and second one was made long time ago.
How can I create the database with both dumps inside but with old_ prefix for tables from the first and new_ prefix for tables from the second database?
Is there any mysqldump options to setup the prefix or other solution?
A "mysqldump file" is just a text file full of SQL statements, so you can make quick modifications like these in a text editor.
1) Dump the two databases individually.
2) Edit the "old" dump file:
use mydatabase; lineold_ in front of the table names. 3) Then, cat dump1 dump2 > combined_dump
4) mysql < combined_dump
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With