Zencart převod dat

1. EXPORT a IMPORT DAT

Přechod ze staré verze Mysql na novou Mysql 5 v kódování UTF-8 se dělá následovně.

Vyexportuji starou databázi v Windows-1250 a na Linux pomocí prográmku iconv převedu na UTF-8 a naimportuji do nové databáze.

syntaxe iconv

Code :

iconv -f windows-1250 -t UTF-8 export.sql > import.sql

Dále je potřeba nahradit v import.sql

character set latin1 collate latin1_bin -> character set utf8 collate utf8_bin

a

CHARSET=latin1 -> CHARSET=utf8

V souboru /includes/classes/db/mysql/query_factory.php

přidat za řádek

if ($this->link) {

if (@mysql_select_db($zf_database, $this->link)) {

$this->db_connected = true;

toto:

@mysql_query („SET NAMES CP1250“);

a za řádek

function selectdb($zf_database) {

@mysql_select_db($zf_database, $this->link);

také přidat toto:

@mysql_query („SET NAMES CP1250“);

Vymazat tabulky categories, categories_description, products a všechny tabulky začínající prefixem products_

insert into categories select * from zen_categories

insert into categories_description select * from zen_categories_description

update categories_description set language_id=2

insert into products select * from zen_products

INSERT INTO products (`products_id`, `products_type`, `products_quantity`, `products_model`, `products_image`, `products_price`, `products_price_old`, `products_item`, `products_virtual`, `products_date_added`, `products_last_modified`, `products_date_available`, `products_weight`, `products_status`, `products_tax_class_id`, `manufacturers_id`, `products_ordered`, `products_quantity_order_min`, `products_quantity_order_units`, `products_priced_by_attribute`, `product_is_free`, `product_is_call`, `products_quantity_mixed`, `product_is_always_free_shipping`, `products_qty_box_status`, `products_quantity_order_max`, `products_sort_order`, `products_discount_type`, `products_discount_type_from`, `products_price_sorter`, `master_categories_id`, `products_mixed_discount_quantity`, `metatags_title_status`, `metatags_products_name_status`, `metatags_model_status`, `metatags_price_status`, `metatags_title_tagline_status`, `catalog_parent`, `waste_id`, `author_fee_id`) select * from zen_products

INSERT INTO `products_description` (`products_id`, `language_id`, `products_name`, `products_description`, `products_url`, `products_viewed`) select `products_id`, `language_id`, `products_name`, `products_description`, `products_url`, `products_viewed` from zen_products_description

NUTNO INSERTOVAT DALSI POLE do products (technicke udaje) !!!

update products_description set language_id=2

insert into products_notifications select * from zen_products_notifications

insert into products_options select * from zen_products_options

insert into products_to_categories select * from zen_products_to_categories

insert into products_xsell select * from zen_products_xsell

insert into product_types select * from zen_product_types

insert into product_type_layout select * from zen_product_type_layout

insert into manufacturers select * from zen_manufacturers

insert into manufacturers_info select * from zen_manufacturers_info

INSERT INTO `manufacturers_info` (`manufacturers_id`, `languages_id`, `manufacturers_url`,`date_last_click`) select `manufacturers_id`, `languages_id`, `manufacturers_url`,`date_last_click` from zen_manufacturers_info

insert into specials select * from zen_specials

insert into featured select * from zen_featured

insert into meta_tags_categories_description select * from zen_meta_tags_categories_description

insert into meta_tags_products_description select * from zen_meta_tags_products_description