Forum Moderators: phranque
Question...what is the best (and easiest) way to get "select" data from existing db into the new db in their appropriate locations? **note: not all current info will be tranferred over to the new one and the tables with the new one will be different from the current.
I've never done this before...
thanks
As you can imagine there are a few options depending on the size and quantity of tables. One of the more forthright approaches would be to use mysqldump [dev.mysql.com] to dump the databases and then use the same utility to import them to the new database. You could then run INSERT ... SELECT [dev.mysql.com] to move the appropriate columns to the new structure.
mysqldump -u username -p database_name -a -B>dbase.dump
that creates a text file called dbase.dump that contains all the neccessary mysql commands to recreate the database.
On the new server:
mysql -u username -p<dbase.dump
which will reinsert the data back into the database.