SeoToaster Upgrade from 2.0 - 2.1 to 2.2

asked Jul 2, 2014 by carlo15 (450 points)
Hello, I am running several websites on SeoToaster v 2.0 and 2.1, many of them with hundreds/thousands of pages. I'd like to upgrade to the latest version, 2.2, also because it will support upgrade to newer versions.

Is there a way to accomplish that?

Is this guide still correct?

http://www.seotoaster.com/questions-and-answers/773/upgrade-instructions-seotoaster-store-seotoaster-ecommerce

Do I need other steps? Thanks!

2 Answers

answered Jul 3, 2014 by Artem (1,320 points)
selected Jul 5, 2014 by carlo15
 
Best answer
Hello,carlo!
Yes, guide still correct, but for step 8 you must use this code:

 --  05/12/2012
 --  'Content' filed type changed for the template table from TEXT to LONGTEXT
 --
 
ALTER TABLE  `template` CHANGE  `content`  `content` LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;


 --  25/01/2013

 
ALTER TABLE  `page` ADD  `preview_image` TEXT NULL DEFAULT NULL COMMENT  'Page Preview Image';


-- 04/02/2013
-- Added option for search results

INSERT INTO `page_option` (`id`, `title`, `context`, `active`) VALUES ('option_search', 'Search landing page', 'Seotoaster pages', 1);


-- 19/03/2013
-- Changed form captcha to recaptcha

ALTER TABLE `form` ADD COLUMN `captcha` ENUM('0','1') DEFAULT '0' NULL;

INSERT INTO `config`(`name`, `value`) VALUES ('recapthaPublicKey', '6LcaJdASAAAAADyAWIdBYytJMmYPEykb3Otz4pp6');
INSERT INTO `config`(`name`, `value`) VALUES ('recapthaPrivateKey', '6LcaJdASAAAAAH-e1dWpk96PACf3BQG1OGGvh5hK');


CREATE TABLE IF NOT EXISTS `form_page_conversion` (
  `page_id` int(10) unsigned NOT NULL,
  `form_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `conversion_code` TEXT COLLATE utf8_unicode_ci NULL,
  PRIMARY KEY (`page_id`,`form_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `form` DROP COLUMN `tracking_code`;


ALTER TABLE `user` ADD `gplus_profile` tinytext COLLATE 'utf8_unicode_ci' NULL;

-- 08/05/2013 15:27:45
-- Mobile template type added
INSERT INTO `template_type` (`id`, `title`) VALUES ('typemobile',    'Mobile page');


-- 15/05/2013 17:34:15
-- Indexes for optimized table
ALTER TABLE  `optimized` ADD INDEX (  `nav_name` );
ALTER TABLE  `optimized` ADD INDEX (  `url`(30) );

-- 18/11/2013
INSERT INTO `config` (`name`, `value`) VALUES ('version', '2.1.0');

-- 21/11/2013
-- Main menu template type
-- version: 2.1.0
INSERT INTO `template_type` (`id`, `title`) VALUES ('typemenu', 'Menu');

-- 19/12/2013
-- User attributes table added
-- version: 2.1.1
CREATE TABLE IF NOT EXISTS `user_attributes` (
  `user_id` int(10) unsigned NOT NULL,
  `attribute` tinytext COLLATE utf8_unicode_ci NOT NULL,
  `value` text COLLATE utf8_unicode_ci,
  PRIMARY KEY (`user_id`,`attribute`(20)),
  CONSTRAINT `user_attributes_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- 26/12/2013
-- SEO Intro fields for optimized table
-- version: 2.1.2
ALTER TABLE `optimized` ADD `seo_intro` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER `teaser_text` ,
ADD `seo_intro_target` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER `seo_intro`;

-- 29/01/2014
-- reCAPTCHA refactoring
-- version: 2.1.3
UPDATE `config` SET `name` = 'recaptchaPublicKey' WHERE `name` = 'recapthaPublicKey';
UPDATE `config` SET `name` = 'recaptchaPrivateKey' WHERE `name` = 'recapthaPrivateKey';


-- 07/04/2014
-- Add unique index into email_triggers
-- version: 2.2.0
ALTER TABLE `email_triggers` ADD UNIQUE INDEX(`trigger_name`, `observer`);

-- 22.05.2014
-- Action triggers e-mail or SMS service type
-- version 2.2.1
ALTER TABLE `email_triggers_actions` ADD `service` ENUM( 'email', 'sms' ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER `id`;

UPDATE `email_triggers_actions` SET `service` = 'email' WHERE `service` IS NULL;

INSERT INTO `email_triggers` (`id`, `enabled`, `trigger_name`, `observer`) VALUES
(null, '1', 'store_neworder', 'Tools_AppsSmsWatchdog'),
(null, '1', 'store_trackingnumber', 'Tools_AppsSmsWatchdog');

INSERT INTO `email_triggers_actions` (`id`, `service`, `trigger`, `template`, `recipient`, `message`, `from`, `subject`) VALUES (NULL, 'sms', 'store_neworder', NULL, 'customer', 'Hello {customer:fullname},
this message is from your favorite store {company:name}.
We received your order on {order:createdat} date for {order:total}.
Your order status is {order:status} and will ship to {order:shippingaddress}.
Thanks for your business.', '', '');

INSERT INTO `email_triggers_actions` (`id`, `service`, `trigger`, `template`, `recipient`, `message`, `from`, `subject`) VALUES (NULL, 'sms', 'store_trackingnumber', NULL, 'customer', 'Hello {customer:fullname},
this message is from your favorite store {company:name}.
Your order {order:shippingtrackingid} for {order:total} placed on {order:createdat} is now {order:status}.
The shipping address for this order is {order:shippingaddress}
Thanks for your business.', '', '');


-- These alters are always the latest and updated version of the database
UPDATE `config` SET `value`='2.2.2' WHERE `name`='version';
SELECT value FROM `config` WHERE name = 'version';
commented Jul 3, 2014 by carlo15 (450 points)
Thank you very much, I'll try it out and let you know how it goes!
commented Jul 5, 2014 by carlo15 (450 points)
Tryed it out with a small website and it works. Thank you so much, this will save me a loooot of time on huge websites!
answered Jul 3, 2014 by Artem (1,320 points)
INSERT INTO `email_triggers` (`enabled`, `trigger_name`, `observer`) VALUES
('1', 'store_newuseraccount', 'Tools_StoreMailWatchdog');

CREATE TABLE IF NOT EXISTS `shopping_product_freebies_settings` (
  `prod_id` int(10) unsigned NOT NULL,
  `price_value` decimal(10,4) DEFAULT 0,
  `quantity` int(4) unsigned DEFAULT 0,
  PRIMARY KEY (`prod_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


CREATE TABLE IF NOT EXISTS `shopping_product_has_freebies` (
  `product_id` int(10) unsigned NOT NULL,
  `freebies_id` int(10) unsigned NOT NULL,
  `freebies_quantity` int(4) unsigned NOT NULL,
  PRIMARY KEY (`product_id`,`freebies_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


ALTER TABLE `shopping_cart_session_content` ADD COLUMN `freebies` ENUM('0','1') DEFAULT '0' NULL;

-- 23/10/2013
INSERT INTO `shopping_config` (`name`, `value`) VALUES ('noZeroPrice', 1);


-- 18/11/2013
-- version: 2.0.0

INSERT INTO `shopping_config` (`name`, `value`) VALUES ('version', '2.1.0');

-- 23/01/2014
-- version: 2.1.1
ALTER TABLE `shopping_cart_session` ADD COLUMN `discount_tax_rate` enum('0','1', '2', '3') COLLATE utf8_unicode_ci DEFAULT '0' AFTER `gateway`;
ALTER TABLE `shopping_cart_session` ADD COLUMN `shipping_tax` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'Shipping Tax' AFTER `sub_total`;
ALTER TABLE `shopping_cart_session` ADD COLUMN `discount_tax` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'Discount Tax' AFTER `shipping_tax`;
ALTER TABLE `shopping_cart_session` ADD COLUMN `sub_total_tax` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'Sub total Tax' AFTER `discount_tax`;
ALTER TABLE `shopping_quote` ADD COLUMN `creator_id` int(10) unsigned DEFAULT '0' AFTER `edited_by`;

-- 15/04/2014
-- version: 2.2.0
CREATE TABLE IF NOT EXISTS `shopping_filtering_attributes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Attribute ID',
  `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Attribute Name',
  `label` tinytext COLLATE utf8_unicode_ci NOT NULL COMMENT 'Attribute Label',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS  `shopping_filtering_widget_settings` (
  `filter_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT 'Filter ID',
  `settings` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT 'Widget Settings',
  PRIMARY KEY (`filter_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS  `shopping_filtering_tags_has_attributes` (
  `tag_id` int(10) unsigned NOT NULL,
  `attribute_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`tag_id`,`attribute_id`),
  KEY `attribute_id` (`attribute_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `shopping_filtering_values` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(10) unsigned NOT NULL COMMENT 'Product ID',
  `attribute_id` int(10) unsigned NOT NULL COMMENT 'Attribute ID',
  `value` tinytext COLLATE utf8_unicode_ci NOT NULL COMMENT 'Attribute Value',
  PRIMARY KEY (`id`),
  KEY `attribute_id` (`attribute_id`),
  KEY `product_id` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- 29/05/2014
-- version: 2.2.1
ALTER TABLE `shopping_quote` ADD COLUMN `internal_note` text COLLATE utf8_unicode_ci AFTER `disclaimer`;

-- 30/05/2014
-- version: 2.2.2
CREATE TABLE IF NOT EXISTS `shopping_import_orders` (
  `real_order_id` int(10) unsigned NOT NULL,
  `import_order_id` VARCHAR(255) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`real_order_id`,`import_order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- 01/06/2014
-- version: 2.2.3
ALTER TABLE `shopping_filtering_values` ADD UNIQUE (`attribute_id`, `product_id`);

-- These alters are always the latest and updated version of the database
UPDATE `shopping_config` SET `value`='2.2.4' WHERE `name`='version';
SELECT value FROM `shopping_config` WHERE `name` = 'version';
...