Forums / Upgrading from 1.3.x to 1.3.9 / 1.3.9d problems after restoring site from backup

1.3.9d problems after restoring site from backup

Locked

Views: 4,892

Results 1 to 20 of 40
This thread is locked. New replies are disabled.
24 Jun 2010, 11:43 PM
#1
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

1.3.9d problems after restoring site from backup

I didnt see any other issues where the counter history has stopped working, but here is the history:
We upgraded the cart from 1.3.8a to 1.3.9c, then the new upgrade of 1.3.9d came along, added those updates, all was well, then the server got hacked. The hack transpired just the next day of upgrading, after the host loaded their latest backup, I was told since my database was at 1.3.9c but the files was back to 1.38a, that I needed to upload my files to 1.3.9c then put in the 1.3.9d files. did that, and all is working just fine with the exception of the counter history in the admin and it has stopped effective 6/22/2010..
I am not sure what file needs to be reloaded or what needs to be done? any help would be appreciated.

26 Jun 2010, 1:31 AM
#2
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

Maybe someone could tell me which files affect the counter? I can possibly try to reload just those files to see if it works then? Or is that not going to work? Anyone?

26 Jun 2010, 7:39 PM
#3
drbyte avatar

drbyte

Sensei

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

Re: 1.3.9d problems after restoring site from backup

Many things can affect it.
I'm unclear what software you're actually running now, since you started talking about 1.3.8 and then 1.3.9 and then restoring from backup with 1.3.8 and then dumping 1.3.9 files overtop and then 1.3.8 files again ...
I'm confused about what your site contains. Maybe your site is confused too?

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

26 Jun 2010, 9:50 PM
#4
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

Ok, I now have 1.3.9d With the database of 1.3.9c

and here is how I got it... (For the second round)
I downloaded the 1.3.8 into a directory, then loaded the 1.3.9c files, checked that to make sure it was functioning correctly, then updated again to 1.3.9d
She also says it is running sluggishly too.. pages loading slowly, etc.
So, if the cart is confused, you are confused, and I am confused, then what would be the best suggestion short of closing up shop? :blink:

I started this thread http://www.zen-cart.com/forum/showthread.php?t=157534 when we were hacked to ask what I needed to do and followed their instructions by just putting the files in? The only thing I didnt do was load the installation files and run through the upgrade process again, should that have been what I needed to do?

26 Jun 2010, 11:12 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: 1.3.9d problems after restoring site from backup

You said you just copied v1.3.9 files overtop of v1.3.8 files? Anybody who told you to do that is just plain wrong. A careful merge needs to be done. And obsolete files need to be removed, etc.
I suppose that could mean that anything involved in any changes made by addons could be causing you problems.

As for counter-history issues, I guess you've probably got enough of a mess that you need to just drop the table and recreate it using the proper structure as found in the mysql_zencart.sql file. Yes, that will delete all the history too. Then put back the /includes/counter.php file and any other files involved in whatever it does ... off the top of my head that's likely all the /includes/functions and /includes/classes files.

I'm always reluctant to ever tell anyone a "specific" set of filenames that might "magically" fix something that's strangely suddenly not working when it "used to work fine", because usually the symptoms at hand are red herrings, and almost always are only symptoms, and not the real root issue, which almost always lies in other core files ... which could be anywhere, typically under the /includes/ folder.

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

26 Jun 2010, 11:24 PM
#6
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

Would there be any danger in uploading all new files for 1.3.9d into a directory and connecting the existing database to it?

26 Jun 2010, 11:32 PM
#7
drbyte avatar

drbyte

Sensei

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

Re: 1.3.9d problems after restoring site from backup

The answer is: it depends. Ultimately that is what you'll do, but that's not all that's involved in a proper upgrade.
For example, there could be remnants of old addons in the old database which may trigger certain things to take place which don't exist if you haven't also added those addons' files to the new site.
Plus, before your visual side can work right, whatever template you have will need to be upgraded to be compatible with the new version, including all customized files, whether related to languages, templates, or anything else.

I get the sense that you're looking for a quick bandage instead of actually carefully fixing the root problem, whatever that may actually be. Now, since it's not actually your site, maybe that's all you care about it. But, if it was my site, I'd be taking the time, whatever it was, to make sure the entire thing was good and clean, both data and files.

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

26 Jun 2010, 11:53 PM
#8
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

I think maybe I didnt explain myself correctly. I did the proper upgrade PRIOR to a hack on the server. And this site was running 1.3.9d with the database at 1.3.9c after the upgrade. All was just fine at that time.

That only lasted a day before the hack happened. The latest backup that the server had was a few days prior to the hack which didnt reflect the files that were for the version of 1.3.9d. Therefore loading the backup said that she was using 1.3.8a which was what she was using prior to the upgrade. But that the database was at 1.3.9c, therefore, I posted the question asking what I needed to do. I then proceeded to load a copy of all the files that were in the zen cart at that time into a "non active" directory. Once doing so, I then as you say, dumped the 1.3.9c files into there as well, taking care to not overwrite all of the custom coding.I then connected those files to the existing database which had already previously been upgraded prior to the hack, and checked it to see if it was working.. everything seemed to work fine, (I failed to check the counter history in the admin) but I didnt see any "errors" otherwise.. so, I changed the name of the directory to her shop The cart seems to be working fine with the exception of the counter that stopped working on that day.
However, you made it sound as if I had more issues than just reloading some files would fix, and no, I am not looking for a bandaid, I need it fixed correctly. The lady depends on me, however, I can only follow the directions for the upgrade, and the hack as well as the backup files being mixed up, doesnt help me any. I dont know enough about any of the coding to seek out the issue, which is why I came here to ask. Then I wanted to know if it would be simpler to start fresh with all new files from the newest version since I do not know the cause of the problems.

I am looking into taking courses in php/mysql etc, so maybe one day I will be able to give back to everyone here that has helped me, but until then, I am still on the receiving end.
I do appreciate your help.

27 Jun 2010, 12:13 AM
#9
drbyte avatar

drbyte

Sensei

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

Re: 1.3.9d problems after restoring site from backup

Okay, so if we back up a bit ...

  • you upgraded to 1.3.9c
  • after that you were somehow hacked, presumably by something that was left on the server from the old vulnerable version, or maybe from something completely outside of your Zen Cart site.
  • then you restored files from an old 1.3.8 backup
  • then it told you it's out of date
  • now you're trying to simply get the 1.3.9c files back onto the server

So, where is the copy of the 1.3.9c files you prepared for uploading to the server (with customizations and merging etc) on the day that you upgraded the server to 1.3.9c? I would expect that you have a copy of all those files at least on your PC someplace (assuming you actually did the file merging, comparisons, customizations, etc on your PC before uploading to the live site), or even better yet, you'd have a full copy of those files and a duplicated testing database, all in another spot on that or another server, for testing the upgrade to be sure it's all working right before taking all the updated files to the live server and upgrading the database. That's how the published upgrade instructions advise upgrades to be done.

Now, if the hack happened as a result of some old vulnerable files being left on your server which didn't belong, then those definitely need to be cleaned out and removed from the server. That's all part of the Recovering From Hack Attempts instructions which are posted in the wiki and in the Hack Attempts discussion area of the forum.

If for some reason you don't have a good set of merged 1.3.9c files on your PC from what went onto the server, then I recommend simply doing the upgrade process over again, to prepare a good set of clean customized files. Then, after making a backup of the server contents, wipe out the Zen Cart files/folders from your server, and upload the new set of files to the server. You'll want to be sure that you don't delete your images, etc, but you do need to make sure that all the files in all your images folders are actually images, and not PHP files or contain something other than pictures even if they have a ".jpg" or whatever extension on them. Make no assumptions. It's all part of cleaning up from hacks.

As you were told in the other thread you mentioned, there's no database changes from v1.3.9a to b to c to d, so you shouldn't need to rerun the database-upgrade component at this time.

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

27 Jun 2010, 12:35 AM
#10
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

Ok, the hack was just a change of all index files on the server that has many sites on it. We were not the only ones that were affected. So, I am not certain where the hacker got in from. I had gone in and reloaded the index files but at the same time, the host was loading backups to the sites and wasnt aware that this site had been done, therefore the version was sent back to an older one.
Now, you mentioned something regarding obsolete files, which I suppose I am guilty of not deleting, how does a person know if it is obsolete or not? I mean, just as you said, just one file for the counter history isnt a simple fix for the problem, because there are many files affected? So, how does a person know which files are needed and which are obsolete?

27 Jun 2010, 2:11 AM
#11
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

Maybe I should rephrase my question ... can you point me in the direction of where I learn to know which files are obsolete and which ones arent during an upgrade?

27 Jun 2010, 4:11 AM
#12
drbyte avatar

drbyte

Sensei

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

Re: 1.3.9d problems after restoring site from backup

This is what I would do:
a) take a copy of your site files that you want to evaluate to see what needs removing
b) take a fresh copy of clean Zen Cart files, in this case you're talking about v1.3.9c, so grab the v1.3.9c zip and unzip it.
c) use WinMerge and compare them by dragging the first folder into one pane, and the other folder into the other pane.
Anything showing in the site-files side that's not in the v1.3.9 files side ... needs to be reviewed to see whether it's legitimate or not.
Similar concept described here: http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

Also, it's prudent to look at the changelog files in the v1.3.9 /docs/ folder to see what it says about new files, deleted files, modified files, and take action accordingly. Note that the v1.3.9a changelog contains info that you'll review first, and then review the v1.3.9b changelog, and then the v1.3.9c changelog. (and then later v1.3.9d, etc when you choose to upgrade again).

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

27 Jun 2010, 12:50 PM
#13
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

Thank you very much for explaining everything to me. I really appreciate it. I will go back through all of the files to see what happened.

27 Jun 2010, 3:26 PM
#14
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

Ok, I am going through the files with a fine toothed comb, and I see in includes/classes that there are files that are not in the zen cart 1.3.9c files... do I make a list and possibly delete? Is that the best approach? I want to learn all I can, so, there wont be trouble in the end. She does not have any mods in her site.

27 Jun 2010, 8:19 PM
#15
drbyte avatar

drbyte

Sensei

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

Re: 1.3.9d problems after restoring site from backup

What are the filenames?

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

27 Jun 2010, 9:22 PM
#16
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

box.php
email.php
logger.php
mime.php
object_info.php
payment_module_info.php
phplot.php
table_block.php

(I deleted them in my test directory, and have uploaded it to my test site, which is not on the same server as the original site, I just need to backup the database and load it into the test server. Then test things to see if it is working properly) I really appreciate the help you have given me, I was doing some things wrong and see that now.

28 Jun 2010, 2:51 PM
#17
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

Ok, I have the site up and running in my test site. And everything seems to be functioning with the exception of the counter history still. I have gone through all the files, and omitted the pages that were obsolete, even created some of the custom pages that were not initially done when the designer created this cart. So, do I go through the process of your instructions before:

*As for counter-history issues, I guess you've probably got enough of a mess that you need to just drop the table and recreate it using the proper structure as found in the mysql_zencart.sql file. Yes, that will delete all the history too. Then put back the /includes/counter.php file and any other files involved in whatever it does ... off the top of my head that's likely all the /includes/functions and /includes/classes files.

I'm always reluctant to ever tell anyone a "specific" set of filenames that might "magically" fix something that's strangely suddenly not working when it "used to work fine", because usually the symptoms at hand are red herrings, and almost always are only symptoms, and not the real root issue, which almost always lies in other core files ... which could be anywhere, typically under the /includes/ folder. *

*If so, I am not 100% sure how to recreate the table. I would be guessing if I attempted it. *

28 Jun 2010, 3:11 PM
#18
toniscraparoni avatar

toniscraparoni

Zen Follower

Join Date:
Apr 2009
Posts:
158
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

I had an issue with the counter history table when upgrading to 1.3.9d from 1.3.9c. My issue was the database "suddenly" didn't like this table's collation, which was utf8, I think? It resulted in admin not displaying at all. Switching it to latin fixed me right up. Not sure if this could possibly help you. As DrB said, sometimes the fix isn't where you think it might or should be. ;)

Good luck!

If you want something done right, you have to get Zenned.
♥-My Zen Cart Mods-♥

28 Jun 2010, 4:03 PM
#19
drbyte avatar

drbyte

Sensei

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

Re: 1.3.9d problems after restoring site from backup

countingsheep:

I am not 100% sure how to recreate the table. I would be guessing if I attempted it.
Go to phpMyAdmin
Select your database from the pulldown menu
Click on the counter_history table
Click on the Export tab
Choose "Structure Only"
Click Go

Paste the output here. (it will be a CREATE statement)

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

28 Jun 2010, 5:20 PM
#20
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1.3.9d problems after restoring site from backup

-- phpMyAdmin SQL Dump
-- version 2.11.9.5
-- http://www.phpmyadmin.net

-- Host: localhost
-- Generation Time: Jun 28, 2010 at 01:09 PM
-- Server version: 5.0.81
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

-- Database: 'wahmcoup_babycute'


--
-- Table structure for table 'zen_counter_history'

CREATE TABLE zen_counter_history (
startdate char(8) NOT NULL default '',
counter int(12) default NULL,
session_counter int(12) default NULL,
PRIMARY KEY (startdate)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;