Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / cannot create session when trying to update database

cannot create session when trying to update database

Locked

Views: 2,801

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
21 Oct 2010, 12:57 AM
#1
Join Date:
Oct 2010
Posts:
7
Plugin Contributions:
0

cannot create session when trying to update database

I swear I have searched high and low on both google and these forums before posting this.

I currently have a 1.3.8 installation of zencart. I am moving to a new server and want to upgrade at the same time. I copied my database to the new server and uploaded a fresh download of 1.3.9g and copied my configure files from the old 1.3.8 install.

My store works except fine except that i get a warning about needing a new patch level. I then try to use the installer to try to perform a DB upgrade, but I run into this error:

Problem Detected

Sorry, a problem has been detected.

This installer needs to be able to start a PHP session in order to complete installation.

I know both the cache folder is writable and the zencart database user has FULL privileges to the database. The instalation page gives me green checks for EVERYTHING.

Anyway I think im gonna outsmart it by logging into the admin area and running the "mysql_upgrade_zencart_138_to_139.sql" script in the "install sql patches" tool. I am able to login and go to the tool but there is a bold red warning saying "NOTE: Zen Cart database-upgrade scripts should NOT be run from this page.
Please upload the new zc_install folder and run the upgrade from there instead for better reliability"

bah I tried that and it gave me the session error (note that since I can login to the admin page obviously sessions work and there are a couple other websites i have on this server using php sessions just fine as well)

I figured Id try running the patch anyway got a syntax error on a drop command fixed it and ran again. got the whit page of death, debugged it, and got this: "PHP Fatal error: Call to a member function add() on a non-object in /redacted/zen-cart/****/sqlpatch.php on line 211"

that line has this: "$messageStack->add('RENAME TABLE command not supported by upgrader. Please use phpMyAdmin instead.', 'caution');"

I guess you really shouldn't try and install sql patches this way which is fine i dropped the database and restored it from back up so I am back where i started.

Again i have a functional store, but the database needs to be upgraded which it will not let me do because of the session error. I know the session is not timing out; the page with the error loads instantly. the cache folder is writeable and i have tried setting session to both file and db in the config file; both produce this error. I have double checked and the zencart user has read write privs to the entire database.

Any ideas?

Edit: I also checked my browser and i am getting a cookies called zenInstallid, zenid, and zenAdminID. I have tried the upgrade in both latest firefox and lates chrome.

Edit2: resetting the browser (clearing both cache and cookies, etc) quitting and retrying has no effect either. didnt think it would, but typically thats the first thing people will ask me to do when troubleshooting such things.

21 Oct 2010, 4:12 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: cannot create session when trying to update database

brad_at_foreverybody:

I currently have a 1.3.8 installation of zencart. I am moving to a new server and want to upgrade at the same time.
DON'T DO THAT.

Either upgrade first, OR move first. ONE OR THE OTHER.
Then after everything's working perfectly, tackle the other.

Otherwise you're likely to end up with unexplainable problems and you won't know what part of the process is causing it, and neither will we, so we won't be able to help you.

Don't try to outsmart anything. It'll just end up outsmarting you.

21 Oct 2010, 4:12 PM
#3
Join Date:
Oct 2010
Posts:
7
Plugin Contributions:
0

Re: cannot create session when trying to update database

Yes this outsmarting me is quite humbling.

I think I fixed it before coming back here tho. I took the upgrade script from zc_install and altered it with my table prefixes and took it in to phpmyadmin and it ran successfully... the store no longer shows the warning to update so does that mean Im good to start reconfiguring and making a new template and such? or would you still recommend I try to move the old store then upgrade it for other reasons?

I'm reluctant to move and upgrade because there was a lot of customizations in the old store that i want to sluff off. I really want to start with a fresh install but still require all my old products and customers etc.

sorry for trying to break the rules; thanks for your help despite that.

21 Oct 2010, 5:27 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: cannot create session when trying to update database

zc_install relies on the /cache/ folder being writable and browser cookies being enabled in order to do its session handling.

21 Oct 2010, 5:49 PM
#5
Join Date:
Oct 2010
Posts:
7
Plugin Contributions:
0

Re: cannot create session when trying to update database

DrByte:

zc_install relies on the /cache/ folder being writable and browser cookies being enabled in order to do its session handling.

The installer gave me a green check next to the cache folder being writable and permission on that folder is currently 777. cookies are most definitely enabled and accepted as i can look at my browser cookies and I have a zenInstallid cookie set. My php.ini only allows session cookies and not the query string method.

Right now everything is working fine, including loging into the admin section, but I failed to sluff off all the additional crap i was trying to leave behind since, apparently, much of that stuff was stored in the DB.

With that said I think I'll attempt a fresh install on this server then import only the customers/products/orders over. is this a bad idea? I havent yet searched for a guide on this, but it seems like i ought to be able to pull it off ok.

My only concern is the installer not letting me install for the same reason it wont let me upgrade the db. I am hopeful that removing my config files and emptying the database will solve that issue. I will now search for a way to import the customers/products/orders from a 1.3.8 db to a 1.3.9 db. Unless somebody wants to help out and post a link.

21 Oct 2010, 6:16 PM
#6
Join Date:
Oct 2010
Posts:
7
Plugin Contributions:
0

Re: cannot create session when trying to update database

deleting the configure files and running the installer again worked. I was able to install a clean install without all the crap from the old store. Now I just need to find out what data I need to import to the new store and from where.

I have this new database and all I want to import is customers/products/coupons/orders and related data. would it be best to insert into the appropriate tables all the data from my old 1.3.8 database or insert the data from the 1.3.9 database that I upgraded from the 1.3.8 database from my previous attempt?

21 Oct 2010, 6:24 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: cannot create session when trying to update database

I have seen people recommend using easy populate to export the info from the old store, massage as desired, and import into the new one.

21 Oct 2010, 6:28 PM
#8
Join Date:
Oct 2010
Posts:
7
Plugin Contributions:
0

Re: cannot create session when trying to update database

gjh42:

I have seen people recommend using easy populate to export the info from the old store, massage as desired, and import into the new one.

excellent info, thanks. Do you know if that can import from an older version to a newer one? I will look into this.

Edit: looked into EP and it lists 1.3.8 for compatibility...

22 Oct 2010, 1:14 AM
#9
drbyte avatar

drbyte

Sensei

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

Re: cannot create session when trying to update database

brad_at_foreverybody:

With that said I think I'll attempt a fresh install on this server then import only the customers/products/orders over. is this a bad idea?
Every time I see someone try to do that they bork it up.

Well, actually, some don't: the ones who don't have any problem with it are the ones who don't have to ask "how" because they already understand databases and relational integrity since they do it every day.

If that's not you, then it's advisable that you wipe your new database, import the old one, run zc_install to do the database-upgrade, and then carry on.

You could remove old database components added by addons by running any provided uninstall scripts that might have been published by the addons' authors. Since you haven't elaborated on anything about the kinds of things you think you need to remove, it's hard to guide you about that.

22 Oct 2010, 1:15 AM
#10
drbyte avatar

drbyte

Sensei

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

Re: cannot create session when trying to update database

As for EP, it only handles products and categories. Not attributes or customers/orders.

27 Oct 2010, 6:42 PM
#11
Join Date:
Oct 2010
Posts:
7
Plugin Contributions:
0

Re: cannot create session when trying to update database

Thanks for the advice Dr. Byte.

I'm 99.9% confident that I have successfully imported products/categories/coupons form the old database correctly. I actually am a webdeveloper with many years of php and mysql experience. I just wanted to use officially supported means of migrating data if possible.

I am now debating about orders. See I didnt import disabled products (discontinued products number in the 1000s for this store) but obviously there were past orders for said products. I dont think I really need the old orders as the orders are automatically being pushed into our ERP system by some custom code I wrote. Since the orders are in that system we also run our reports form that system so the only side effect i can think of are customers not being able to look up order history from the old orders.

if i did choose to import orders would it be benign to have order products that do not exist in the products table? (i did import the products_id from the old store so they have the same id in the old and new database)

if i didnt bring orders in I am assuming setting the auto increment for the orders_id column on the orders table to that of the old store would be sufficient to have the new orders start incrementing from where they left off. is that a safe assumption?

again sorry for breaking the rules. I assure you a donation is in your future :P (even if you cant help me here, zencart is great stuff, kudos)

27 Oct 2010, 7:12 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: cannot create session when trying to update database

I can't answer about the discontinued products, but you can set the order id to pick up where the old store left off. You don't do that in the db, but in admin > Tools > Store Manager > Reset Current Order ID.

27 Oct 2010, 8:07 PM
#13
Join Date:
Oct 2010
Posts:
7
Plugin Contributions:
0

Re: cannot create session when trying to update database

gjh42:

I can't answer about the discontinued products, but you can set the order id to pick up where the old store left off. You don't do that in the db, but in admin > Tools > Store Manager > Reset Current Order ID.

Thanks! I'll do that instead of using a sql command in phpmyadmin.