Site maintenance: Sun 15 Nov, from 20:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Upgrading from 1.2 to 1.3.x / Copy MySQL database from 1.2.6 to 1.3.7.

Copy MySQL database from 1.2.6 to 1.3.7.

Locked

Started by idtags on 13 Oct 2007, 3:31 AM · Views: 4,965

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
13 Oct 2007, 3:31 AM
#1
idtags avatar

idtags

Zen Follower

Join Date:
Aug 2005
Posts:
315
Plugin Contributions:
0

Copy MySQL database from 1.2.6 to 1.3.7.

I am planning to start new Zen Cart 1.3.7 on new domain.

My old domain has Cart 1.2.6.

Is it possible and practical to install 1.3.7 (which my hosting IP does automaticaly) and then copy or Import original data base with products and customers.

After that continue with customization.

As I understand template from 1.2.6 will not work in 1.3.7 anyway.

What document will be suitable for this case?

Thanks for help in advance.

13 Oct 2007, 6:01 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Copy MySQL database from 1.2.6 to 1.3.7.

Yes, that is essentially how the upgrade process works.

Set up a new shop with the new version in a new folder and new database using same db_prefix as the old site. Keep the new configure.php files. Import a copy of the old database into the new database. Run zc_install again and choose database-upgrade. Follow the prompts. That deals with the database side.

Then merge your PHP files ... if you're going to build a new template you may not need to merge those files. But if you've made any customizations or added any contributions, you'll need to manually redo all of those into the new code. The merging/upgrading of files is the tedious part.

There are FAQs on the upgrade process in the /docs folder of your Zen Cart files and also in the FAQ area at https://tutorials.zen-cart.com . You could also search the forum for "/new_shop" for some articles that Ajeh has written on the process.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Oct 2007, 11:22 PM
#3
tat2nu avatar

tat2nu

Zen Follower

Join Date:
Jan 2005
Posts:
178
Plugin Contributions:
0

Re: Copy MySQL database from 1.2.6 to 1.3.7.

I am in the same exact situation. I have been using 1.2.6 for a very long time. I tried paying someone to build me a new site using 1.3.7 last year and all I got was a lot of excuses and nothing for my money. I spent some time building my new site myself and I am somewhat happy with it to be honest. No I can not decide if I should just start clean or try and get my old database to work in the new store. I like the idea a a perfectly clean start but I would not be happy losing all of my old customer information and order history.

Please explain what you mean when you say merge the php files. I am competent to find and replace code as instructed and simply make sure that I backup every page before I try and modify it but the database is a foreign language to me all together and I am terrified of screwing something up there and being forced to start fresh.

I could use a little step by step instruction if anyone has a few minutes to spare or maybe point me to something very detailed that I can follow that already exists.

Old store is https://www.needlejig.com/store
New store is https://www.needlejig.com/shop

I listed the url if that helps.

Thanks,
Marc

18 Oct 2007, 1:14 AM
#4
tat2nu avatar

tat2nu

Zen Follower

Join Date:
Jan 2005
Posts:
178
Plugin Contributions:
0

Re: Copy MySQL database from 1.2.6 to 1.3.7.

I also forgot to ask if the EZ Pages information is saved in the DB because I have used a number of them in the new site and need to know if I have to save the text to be pasted in the new site after I upgrade. I am not sure why I am so scared of the DB. I am sure that it is easy but I just have no real experiences with them.

Thanks,
Marc

18 Oct 2007, 1:26 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Copy MySQL database from 1.2.6 to 1.3.7.

tat2nu:

but the database is a foreign language to me all together and I am terrified of screwing something up there and being forced to start fresh.
The database-upgrade step is mostly automated ... we provide a tool to handle that for you.
You have to do the PHP files manually though.

tat2nu:

Please explain what you mean when you say merge the php files. I am competent to find and replace code as instructed and simply make sure that I backup every page before I try and modify it
Conceptually, you compare your existing site files against the original untouched version of those files ... ie: if you had v1.2.6 installed on your site, then you'd compare your current site against the originally-distributed v1.2.6 files.
You're looking for all your customizations ... ie: any differences from the original files would be things you changed for one reason or another.

After you've identified all those changes, and the reason why you made them, you "merge those" into the new (ie: v1.3.7) files ... "merging in" isn't exactly a copy/paste. In some cases it'll be a re-working of the customized logic into the new code ... sometimes things get moved around esp between major releases.

In the case of templates, you should prepare to redo your template over again since you're moving between major releases ie: 1.2 had a VERY different template structure than 1.3 does. While there are some similarities, you'll get a finished result faster by starting from scratch than by trying to figure out individual pieces to upgrade them.

So, make a list of your customizations, recreate them in a new set of v1.3.7 files (or whatever new version you're upgrading to), and go from there.

If you stage the whole thing in a temporary development area, you can play around with things until you're satisfied. Then when you're comfortable that all is right, you can do a database upgrade to the live site and update the live PHP files as well, and you're up and running.

It's not something you'll do in one sitting.

tat2nu:

I could use a little step by step instruction if anyone has a few minutes to spare or maybe point me to something very detailed that I can follow that already exists.https://www.zen-cart.com/tutorials/index.php?article=98
https://www.zen-cart.com/tutorials/index.php?article=108

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Oct 2007, 2:04 AM
#6
tat2nu avatar

tat2nu

Zen Follower

Join Date:
Jan 2005
Posts:
178
Plugin Contributions:
0

Re: Copy MySQL database from 1.2.6 to 1.3.7.

Thanks for the fast reply. When I go to the DB there are a number of ways to export(I assume that is how I back it up) but I am not sure which options to use. Suggestion please...

I am not going to try and use my old template system. I have already set up a new template override for the new site with a fresh look.

I do not think I have any modifications to the original 1.2.6 files but I will check.

I am mainly concerned with keeping my customer information. If I can keep the order history that is a bonus but I really do not need my products or catagories because I am going to go back and rewrite each one anyway with better descriptions and new pictures. Can I just keep the customer information? would that be easy to export and import to the new store that I have built with 1.3.7?

Thanks again,
Marc

18 Oct 2007, 2:37 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Copy MySQL database from 1.2.6 to 1.3.7.

The FAQ area has tons of useful articles.
I just searched on "backup" and this was the first article, which contains recommendations for which settings to use for making your backup.
https://www.zen-cart.com/tutorials/index.php?article=103

As to how to keep your old data ... just follow the upgrade docs I referenced earlier. All your data will be retained. If you're unfamiliar with databases, as you mentioned, then getting into partial exports/backups is not recommended. No need to complicate things.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Oct 2007, 2:41 AM
#8
tat2nu avatar

tat2nu

Zen Follower

Join Date:
Jan 2005
Posts:
178
Plugin Contributions:
0

Re: Copy MySQL database from 1.2.6 to 1.3.7.

I just need one more bit of information.

Where can I find a clean original copy or ZenCart 1.2.6?

I have searched online and have not been able to locate one.

Thanks,
Marc

18 Oct 2007, 2:52 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Copy MySQL database from 1.2.6 to 1.3.7.

SourceForge contains all our software releases.
The v1.2 series files are here: http://sourceforge.net/project/showfiles.php?group_id=83781&package_id=125709

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Oct 2007, 1:19 AM
#10
tat2nu avatar

tat2nu

Zen Follower

Join Date:
Jan 2005
Posts:
178
Plugin Contributions:
0

Re: Copy MySQL database from 1.2.6 to 1.3.7.

I hate to be such a pain but I tried to start merging my files today and it did not go well. I think that the problem is that I have 1.2.6 and the only original that I could download was 1.2.6d. Is there a big difference and should this cause me major conflicts? Should I try and find an original 1.2.6 ZenCart?

Marc

19 Oct 2007, 1:56 AM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Copy MySQL database from 1.2.6 to 1.3.7.

Zen Cart v1.2.6 was named v1.2.6d ... so, you probably have the only files ever released for it.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Oct 2007, 6:12 PM
#12
tat2nu avatar

tat2nu

Zen Follower

Join Date:
Jan 2005
Posts:
178
Plugin Contributions:
0

Re: Copy MySQL database from 1.2.6 to 1.3.7.

Ok, here is what's wrong. WinMerge basically brings back every single one of the 1832 items as different except for the original gif files. If I look through the first few lines of items I see that the active files for my store have an extra blank line between each line of text where the original item does not have these blank lines and that is enough to make the files different.

Do I have to read and compare each line of code for all 1832 items individually because if that is the case I quit before I even start.

Is this "merge" step really necessary if I only want to keep my data and not the templates of my old store? Am I completely beat on this? Should I just start everything over and loose my 2500+ clients information?

I am so frustrated at this point I just want to hit something but I am sure my laptop can ot take that kind of abuse.

Marc

19 Oct 2007, 6:40 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Copy MySQL database from 1.2.6 to 1.3.7.

There are some tips here for helping WinMerge skip lines that are only version-number differences:
http://www.zen-cart.com/forum/showthread.php?t=7330

tat2nu:

Ok, here is what's wrong. WinMerge basically brings back every single one of the 1832 items as different except for the original gif files. If I look through the first few lines of items I see that the active files for my store have an extra blank line between each line of text where the original item does not have these blank lines and that is enough to make the files different.
Are you working from a set of files that you downloaded from your site?
If all your files are double-spaced after downloading them, then your FTP program may have added the double-spacing due to line-ending differences between Linux and Windows. Sometimes this is a result of transferring the files in binary mode instead of text mode. (PHP files should always be transferred in ASCII (text) mode.)

Perhaps you may have a set of files on your computer that you modified directly without ever downloading from your live site. Maybe they'll be more reliable.

You could also experiment with the tools mentioned in this thread to try and convert the line-endings to work more friendly with your Windows PC:
http://www.zen-cart.com/forum/showthread.php?t=76474

tat2nu:

Do I have to read and compare each line of code for all 1832 items individually because if that is the case I quit before I even start.No, that's what the comparison program does for you.

tat2nu:

Is this "merge" step really necessary if I only want to keep my data and not the templates of my old store?That all depends on what customizations you made to your store. If all you EVER did was set some colors on your template and didn't change any other files, then you can probably get away with only comparing your language files.

But, I can't tell you to just go ahead and skip files, or you'll be coming back and telling me that everything's busted and demanding that I fix things for you.
Instead, we tell you the "process".

If you want to risk it and only keep the data, then just do the database-export/import/upgrade step, and then manually re-build all your language and template components. Then sort out any other missing issues separately after the fact. If you've installed any mods or customized any core files, you'll miss those if you don't do the comparison to identify them and then rework them into the new code.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Nov 2007, 8:56 AM
#14
jmcqueen avatar

jmcqueen

New Zenner

Join Date:
Oct 2004
Posts:
75
Plugin Contributions:
0

Re: Copy MySQL database from 1.2.6 to 1.3.7.

tat:

how did you come out? please post your results.

john

http://www.ExtremaHosting.com

Favorite Quote: "If your output exceeds your input, then your upkeep will be your downfall." (anon.)

14 Nov 2007, 4:15 AM
#15
tat2nu avatar

tat2nu

Zen Follower

Join Date:
Jan 2005
Posts:
178
Plugin Contributions:
0

Re: Copy MySQL database from 1.2.6 to 1.3.7.

:clap: I was changing servers from Godaddy to Camelot so I did not have any conflicts between my new and old databases on the same server at the same time.

I set up my new hosting account with Camelot-Hosting and had them do a fresh install of 1.3.7 for me.

I then added my template, product images and EZ pages.

I placed my active store "Down for maintenance" backed up and sent Camelot my database.

Camelot checked, installed and upgraded my database for me.

I had to reinstall my payment and shipping modules.

I had to rewrite my "define pages editor" pages.

I changed my DNS to point to the new server and that was pretty much it.

After that I just have been modifying the look of my new site a little bit but it has been functioning and making me money the whole time. I think my site was down for about 6-8 hours total and that could have been a lot less if I could type without looking at the keys.

Marc