简体   繁体   中英

phpmyadmin import/export -adding new structure to old tables without altering the data

I have a web app that I have made a new version of. The new version adds some new fields to some of the tables. I have an instance of the old version of the web app that has data I do not want to erase. However, I would like to add the new fields (which would at first be empty) to the tables in the old version.

Can I use phpmyadmin to create an export .sql file of the structure of the new version, and then import the .sql file into the old version, adding the new fields, but not altering any old data?

When I try exporting/importing the structure only, I get a message that says the table already exists. This is true, but the table has new fields. How can I get the new fields in there and leave the rest of the data (and associated older structure) intact.

Thanks

I'm not sure why you're concerned about performing an export and then import over top of the existing database; you can simply edit the structure (from the Structure tab) in place without needing to do any export or import. There's an area at the bottom to add a column:

在此处输入图片说明

As with all changes to your database, you should of course have a good backup first, but this should be non-destructive.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM