Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / Problem during upgrade (after renaming tables to remove zen_ prefix)

Problem during upgrade (after renaming tables to remove zen_ prefix)

Locked

Views: 2,756

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
11 Dec 2007, 3:42 PM
#1
rainthebat avatar

rainthebat

Zen Follower

Join Date:
Feb 2007
Posts:
314
Plugin Contributions:
0

Problem during upgrade (after renaming tables to remove zen_ prefix)

I got the blank screen as well. As I don't follow instructions well, I ended up having to go through the new database (1.3.8) and visually compare it to the old database (1.3.7). I opened a backup SQL of 1.3.7 database and compared it to the 1.3.8 database in the zc_install/sql/mysql_zencart.sql.

I used the 'Install SQL Patches' and the 'PHPMyAdmin' on my server to go through every table manually. Made sure that all the table prefixes were named correctly, then would insert the old data into the new (1.3.8) tables.

This method took some time, and trial and error, but I highly recommend it in order to get to know about what is going on behind the scenes in your database.

One must be very thorough and check/double check that everything looks correct.

After getting some errors in the admin area, I had to change a few lines of code in admin/includes/fuctions/general.php to match up with the database tables.

11 Dec 2007, 3:48 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Problem during upgrade (after renaming tables to remove zen_ prefix)

rainthebat:

After getting some errors in the admin area, I had to change a few lines of code in admin/includes/fuctions/general.php to match up with the database tables.

Huh ?

11 Dec 2007, 4:09 PM
#3
rainthebat avatar

rainthebat

Zen Follower

Join Date:
Feb 2007
Posts:
314
Plugin Contributions:
0

Re: Problem during upgrade (after renaming tables to remove zen_ prefix)

I was getting errors under the configuration menu in several areas. If anything I may have changed something in the database configuration table because I was changing all my table prefixes from 'zen_' to 'Z_' and did an auto replace on lots of them and perhaps it replaced one of 'zen_' that wasn't a table prefix in the configuration table data area. But I could not find that if that is what happened. So after getting errors that pointed to my admin/includes/functions/general.php file, I changed the functions it was identifying as problematic from:

function zen_get_country_name($country_id)

to:

function Z_get_country_name($country_id)

and changed several of these as well from 'function zen_cfg...' to:

function Z_cfg_pull_down_country_list($country_id, $key = '')
function Z_cfg_pull_down_country_list_none($country_id, $key = '')
function Z_cfg_pull_down_zone_list
function Z_cfg_pull_down_tax_classes
function Z_cfg_textarea($text, $key = '')
function Z_cfg_textarea_small($text, $key = '')

and a few others.

Please forgive me, but I like to see errors go away fast and resort to sometimes unconventional methods, and hey, in this case it worked.

I will check the table zen_configuration again to see if I can pinpoint where I may have changed something other than the table prefix.

11 Dec 2007, 4:13 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Problem during upgrade (after renaming tables to remove zen_ prefix)

The set_function and use_function columns of the configuration and product_type_layout tables have "zen_" in the function names referenced therein.

Thus, your move to blindly search-and-replace all "zen_" instances was overly aggressive.

If you're going to rename your tables, be sure to ONLY rename tables ... not all the data inside those tables.

11 Dec 2007, 4:16 PM
#5
rainthebat avatar

rainthebat

Zen Follower

Join Date:
Feb 2007
Posts:
314
Plugin Contributions:
0

Re: Problem during upgrade (after renaming tables to remove zen_ prefix)

I found where I made the errors. I changed the table data such as:

'zen_get_country_name', 'zen_cfg_pull_down_country_list

to:

'Z_get_country_name', 'Z_cfg_pull_down_country_list

etc.

got a little tangled up there. Thanks for the help. Will change the functions in admin/includes/functions/general.php back to origonal and make appropriate database zen_configuration table changes.

11 Dec 2007, 4:23 PM
#6
rainthebat avatar

rainthebat

Zen Follower

Join Date:
Feb 2007
Posts:
314
Plugin Contributions:
0

Re: Problem during upgrade (after renaming tables to remove zen_ prefix)

It was an over aggressive move, but with thousands upon thousands of prefixes to change over (because the tables prefix comes up every time there is and INSERT command), it seemed appropriate at the time. I wish I could change my overly aggressive attitude, and perhaps by thinking about it I could.