MySQL Export / Dump and Import
Posted on 2014-01-20
I am working with a large mysql database (a couple GB) and some tables are very large. I am wondering how I can export data from one database and import the data into another mysql database on a different server.
So far, I've got these parts of the process working:
- Exporting of data into a .sql file
- Copying of the data from server to server
- I can import the data if I was happy with the table names.
The problem is the table names are different. The structure is the same.
I can just import the data then copy the data from the old table to the new one and delete the old one but I'm wondering if it's possible to…
Import the .sql data into the table (which has a different table name) directly. I know there's probably a way to do a replace of the .sql since that's just a text file… however, how do you know if the data isn't getting replaced as well since some of the table names are quite generic (like "users")?
I can have the exported .sql in separate files so that each export dump contains different table data if that's easier.