Friday, March 6, 2009

Removing Dreamscape's SEO 3.0 Beta from Zen-Cart

note: This article is intended for a technical audience -- you should use extreme caution when modifying a production system, as your data will be nearly impossible to recover if you use this command incorrectly -- caveat emptor.

One of the more painful things to do in Zen-Cart is removing references to broken module code from your database. You can remove all the PHP files you like, but you'll still see references in your Administration pages for the modules.

In a recent request, I had to switch multiple shops from Dreamscape's SEO 3.0.0beta1 to "something better" due to a change by several shared hosting providers to use SUPHP to protect their client accounts.

After choosing Simple SSU (which is, rather a well written module and is well supported by it's author) -- we were left with the problem of the Configuration Menu in Zen-Cart's admin having two SEO references, one to SSU, one to the older code.

For anyone in the same boat, you can use the following SQL to remove the older module's SQL code from your database:

From the Administration Panel, Go to "Tools -> Install SQL Patches" and enter the following code:

SET @configuration_group_id=0;
SELECT (@configuration_group_id:=configuration_group_id) FROM configuration_group WHERE configuration_group_title = 'Seo Urls 3.0.0-beta1' LIMIT 1;
DELETE FROM configuration WHERE configuration_group_id = @configuration_group_id AND configuration_group_id != 0;
DELETE FROM configuration_group WHERE configuration_group_id = @configuration_group_id AND configuration_group_id != 0;

note: That's four seperate lines with the ;'s ending each line.

I've also posted this as a solution to the thread on the Zen-Cart forums, you can follow the further discussion there -- if you'd like.

No comments: