View Full Version : Importing New sql structure only
RayRippey
03-17-2010, 10:36 PM
I can import a new data structure by exporting with phpadmin, then importing to another database. However, I added some new fields, exported (just the structure) using phpadmin. Now I want to import and update just the structure and I get an error saying my table already exists... and I don't want to have to lose the data.... Can I even do this with PHPadmin? I know I can manually add the fields... but that's not going to work if I have lots of the same data tables out there that need new fields.
Thanks ahead of time.
Fumigator
03-17-2010, 11:21 PM
You have the issue of what data is going to be loaded into the new columns. If you have a plan for that, you can run an ALTER TABLE query on the 2nd database and it won't destroy the data already present.
You want to continue to try using import/export, you might want to try exporting only the data from the 2nd database (make sure "complete inserts" is checked) and then you can drop the tables, import just the structure, and then import the data.
Make sure you backup the databases before you test all this out :thumbsup:
Yeh I would copy the 'live' database using something like phpMyAdmin and call it database_bak so you can't lose anything. Then I would copy the db again and call it 'db_test'. db_test, is the one I would use to make my changes to and when tested and working fully, I would delete the live db and rename the new one to the name of the live one.
Might sound convoluted but it lets you keep the current db active and to update the new one ready for its launch.
bazz
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.