If you are using phpMyAdmin. Click on the old database if you want to use the data in the whole database or choose the table with the data you would like to transfer.
Click on Export. Leave format as SQL and click go.
An SQL file should download to your desktop.
If you have already created the new tables, open the downloaded sql file and edit out all the information except anything that starts with INSERT INTO TABLE
. You will observe that all the insert statements have the table names listed directly after them. So in your case it would look like:
INSERT INTO `accounts` (`id`, `name`, `address`) VALUES (1, 'John Doe', '44 St. NW'),
This means that your data would be inserted directly into those columns. Id=1, name= John Doe, and Address = 44 St. NW. The fourth column you added will remain empty.
Finally, click on the database that contains your new table. Click on import (again assuming you are using phpMyAdmin). If all your table names are exactly the same, it should run without error and import all your old data to your new table.