Forums / Upgrading to 2.x.x / Importing new data from old db into new dev db just before going live

Importing new data from old db into new dev db just before going live

Views: 156

Results 1 to 7 of 7
4 Jul 2026, 4:14 PM
#1
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
859
Plugin Contributions:
0

Importing new data from old db into new dev db just before going live

Hello All,
ZC1.5.8 to ZC2.2.2.
I complete a new upgrade just a few weeks back and moving was easy since that site rarely has a sale. All work was done and everything moved before ever getting a new customer or order. I'm now working on moving a very active site.

So about two weeks ago I installed a fresh new zc2.2.2 into dev area on DB-2. I then copied live (DB-1) to dev (DB-2). After that, ran the installer again to upgrade DB-2.

Since then I've done a bunch of work on the dev. Making changes to layout, adding new plugins, or new versions of old plugins etc.. During this time the live site has had new customers, orders, product description updates and more.

I'm now ready to take the dev site live, but it's been a very long time since I've had to do this on an active site. Please describe the best process and db export settings for updating DB-2 from DB-1 while also importing any new records from DB-1 to DB-2.

Thank you,
John

4 Jul 2026, 5:20 PM
#2
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
859
Plugin Contributions:
0

Re: Importing new data from old db into new dev db just before going live

I'm thinking that I want to export and import one table at a time and do so using csv rather than sql. I'm thinking I also want to use the option to "Update data when duplicate keys found on import". I just copied the dev db to a playground db. I'm going to be working at this a while. Please let me know your thoughts.

Thanks again,
John

4 Jul 2026, 9:24 PM
#3
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
859
Plugin Contributions:
0

Re: Importing new data from old db into new dev db just before going live

Kinda feel like I'm supporting myself here lol... Here's the game plan. Put the live site down for maintenance, copy the live db into a new location, run the 2.2.2 installer to patch that up to 2.2.2, then export each of those tables (address book, customers, orders, products, etc) into individual csv files. Import those into the dev db I've been working with, leave the new fileset hooked up to that db and move the new files into place.

If something doesn't sound right, please let me know. If I find something isn't working out... well I guess I'll post back again.

Thanks again ;)

4 Jul 2026, 10:27 PM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,864
Plugin Contributions:
18

Re: Importing new data from old db into new dev db just before going live

Piecemeal database moves have always resulted in, well, pieces for me. I always do a database upgrade. It's what works for me. BACKUP EVERYTHING FIRST!

With mods that are current for your version of ZC, once your files are in place, you should be able to take most any ZC database and attach it to your code.

Images for the products in the database are more of a concern if you have added, changed, deleted, or discounted products since the original DB was brought over. One major image overlooked in an upgrade is the store's email header.jpg in the emails directory, but that's not part of the database.

Did you use a prefix on one and not the other? That can be a concern.

Have you changed the admins or their passwords? You will need to know how to access any DB you bring in.

Set both sites to Down for Maintenance.

Remove the current DB and drop the older DB into the site.

Run zc_install to upgrade the DB.

Log in to the Admin and keep an eye out for plugins updating. That's a good sign that your core files are working with this DB.

Make sure all your Plugins (especially Display Logs), Payment Mods, and Shipping Mods are installed for the new site. (If using Square WebPay you may need to do some maintenance to make it work).

Use Admin > Tools > System Inspection to check whether something is unrecognized or not working.

Once you have all the mods running and System Inspection is good to go, you can copy the dev to your store's root, update the two configure.php files, and remove the Down for Maintenance.

Be sure to monitor the admin as often as possible for the next few days to catch any glitches that didn't show up in the initial transfer.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

4 Jul 2026, 11:58 PM
#5
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
859
Plugin Contributions:
0

Re: Importing new data from old db into new dev db just before going live

dbltoe:

Piecemeal database moves have always resulted in, well, pieces for me...

Thanks for the pointers. Lots of good advice there. :thumbsup:

I've been at this since 2007 and have always done one export and one import using the sql files with drop table and add if not exists. For some reason though this one is trippin me out with all the changes to the database fields from 158 to 222 and then all the changes in plugins that we use. I figured if I do one table at a time, if / when an injection breaks I'll feel much more confident resolving that one issue and moving.

I was aiming for getting this done tonight, but I'm thinking I might just work at getting it right throughout the week as time permits and then commit next saturday night.

Thanks again,
John

5 Jul 2026, 11:52 AM
#6
brittainmark avatar

brittainmark

Totally Zenned

Join Date:
Apr 2009
Posts:
509
Plugin Contributions:
1

Re: Importing new data from old db into new dev db just before going live

I had an issue importing my Mariadb dump in to my test SQL server. Added "--extended-insert --net-buffer-length=16384" to the dump and it then worked fine on import.

Mark Brittain
http:\innerlightcrystals.co.uk\sales\

5 Jul 2026, 5:11 PM
#7
bumba000 avatar

bumba000

Totally Zenned

Join Date:
Feb 2007
Location:
Pennsylvania
Posts:
859
Plugin Contributions:
0

Re: Importing new data from old db into new dev db just before going live

Over all these years I clearly haven't taken enough time to really learn about database stuff. In my defense... how often do I really need to deal with it though? Not very often! Maybe every few years or so, so I make due and I get by. I'll have to remedy that.

As for now, I woke up this morning wondering why am I making such a big deal over this. I've updated zencart sites a good number of times. Maybe I'm just over thinking it.

Traffic was very low this morning so I went at it and got the job done. Everything is in place. New site is up and running and we're generating no error/warning logs.

Heart rate is back to normal. :smile:

Thanks to those who chimed in.

John