Forums / Upgrading to 1.5.x / Need to downgrade v1.5.0 to v1.3.9. How to do this?

Need to downgrade v1.5.0 to v1.3.9. How to do this?

Started by enigma666666 on 30 Jul 2012, 8:33 AM · Views: 1,903

Results 1 to 5 of 5
30 Jul 2012, 8:33 AM
#1
enigma666666 avatar

enigma666666

Zen Follower

Join Date:
May 2010
Posts:
142
Plugin Contributions:
0

Need to downgrade v1.5.0 to v1.3.9. How to do this?

Hi guys,

I need some guidance here please. I have installed Zencart v1.5.0 (via server install script) and after doing quite a bit of work to get things looking like I want it, I started setting up payment modules yesterday and encountered a problem with one of the modules..

The problem I have, is that the main payment module I will be using "Payfast" does not seem to work on this version of Zencart. I have successfully used it with earlier versions of Zencart. I have subsequently contacted Payfast and they have informed me that I have to downgrade Zencart to v1.3.9 in order use the module since their module will only be compatible with Zencart v1.5.0 in a few months time.

Since I need to have this payment module working, I definitely need to downgrade now, but do not have a clue as how to do this manually.
I have made back-ups of sql and have downloaded it already.
Do I simply manually upload v1.3.9 files via ftp and override v1.5.0 files?

30 Jul 2012, 9:55 AM
#2
enigma666666 avatar

enigma666666

Zen Follower

Join Date:
May 2010
Posts:
142
Plugin Contributions:
0

Re: Need to downgrade v1.5.0 to v1.3.9. How to do this?

Nevermind, since I'm in a hurry to get the site up and running, I have decided to instead uninstall version v1.5.0 and I'm now manually installing v1.3.9.
So a reply to my original question is not that urgent anymore....

But having said that, if there is indeed a simple way to downgrade, please do let me know though as it will be good to know for future reference.

30 Jul 2012, 3:55 PM
#3
drbyte avatar

drbyte

Sensei

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

Re: Need to downgrade v1.5.0 to v1.3.9. How to do this?

That's why we always advise to do your upgrade in a testing area, separate from the live website, first. Then once you've tested everything, including payment handling, you can apply the upgrade to the live site. This results in almost no downtime for the customer and avoids emergencies such as you're posting about today.

A proper "downgrade" would be the following steps:
a) delete the new version from your server
b) restore all the files for the old version, from your backups
c) restore the database for the old version, from your backups.
Done.

Naturally, downgrading a live site by going back to backups will result in losing any data added to the database since the last backup. Yet another reason why testing in a staging area is smart.

.
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.

30 Jul 2012, 4:20 PM
#4
enigma666666 avatar

enigma666666

Zen Follower

Join Date:
May 2010
Posts:
142
Plugin Contributions:
0

Re: Need to downgrade v1.5.0 to v1.3.9. How to do this?

Ok for those who might need to downgrade, this is what I did.

Since I've already set up categories, zones, taxes etc and didn't want to have to redo it, I went into phpmyadmin and exported database as text and copied and pasted it into notepad and saved to desktop.
Since alot of customizations were already done on the template, I also didn't want to have to redo it, so via ftp I downloaded my template files under includes/template/my template and saved it to desktop.

I then went into phpmyadmin and deleted all tables. I did not delete the database though, just left it empty.
I then logged into my server admin area and uninstalled zencart v1.5.0.

I downloaded v1.3.9, extracted and uploaded to server via ftp and then renamed includes/dist-configure.php and admin/includes/dist-configure.php to configure.php and changed the permissions on it to 777.
I also changed permissions on the following folders: (these two tips I got from http://www.kerrinhardy.com)

/cache
/images
/includes/languages/english/html_includes
/media
/pub
admin/backups

/admin/images/graphs

I then ran the Zen Installer in my browser and since the database and all file permissions were already set up beforehand, I had no problem with the manual install.

I logged into Zen Admin to check if all is ok and it was.
Next via ftp I uploaded the original copy of my template except for the includes/templates/my template since I made changes to the css and other files in that folder, so I needed to instead upload the files which I downloaded earlier, before I uninstalled zencart. So I then uploaded my modified template files into includes/templates/my template.

Next I opened up the sql text file I saved earlier in notepad and in phpmyadmin, I deleted everything in the sections where I have done modifications ie categories, zones, taxes etc. So after deleting everything under eg categories, I clicked on sql tab in phpmyadmin, then I looked for the corresponding data entries I saved in sql text file in notepad, I highlighted the relevant statements, copied and then pasted it into sql window in phpmyadmin, then click the go button. All queries were executed successfully. I did this one by one, for each section where I needed the info restored to what it was before the downgrade.

End result, it took a few minutes to do and I have the site up and running properly like it was before without having had to edit anything.

After that I just re-uploaded all the mods I had previously installed and everything is working perfect.

30 Jul 2012, 4:24 PM
#5
enigma666666 avatar

enigma666666

Zen Follower

Join Date:
May 2010
Posts:
142
Plugin Contributions:
0

Re: Need to downgrade v1.5.0 to v1.3.9. How to do this?

Thanks DrByte, looks like we posted at the same time.
Yes I know I should have first tested everything before doing all the customizations but got so used to Payfast module always working and was in such a hurry to finish the site and launch it, that I didn't test things properly first.
It was a fresh install though, not an update, the server side installation has v1.5.0 so I just installed and started customizing everything, leaving Payfast module installation for last.Lesson learned for sure.:smile:

DrByte:

That's why we always advise to do your upgrade in a testing area, separate from the live website, first. Then once you've tested everything, including payment handling, you can apply the upgrade to the live site. This results in almost no downtime for the customer and avoids emergencies such as you're posting about today.

A proper "downgrade" would be the following steps:
a) delete the new version from your server
b) restore all the files for the old version, from your backups
c) restore the database for the old version, from your backups.
Done.

Naturally, downgrading a live site by going back to backups will result in losing any data added to the database since the last backup. Yet another reason why testing in a staging area is smart.