Zen Cart Logo
Forums / General Questions / Problems importing osc database

Problems importing osc database

Locked

Views: 4,415

Results 1 to 20 of 26
This thread is locked. New replies are disabled.
29 Nov 2007, 1:58 AM
#1
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Problems importing osc database

I recently Moved to Zen form OSC and I cannot for the life of me get a green light on an import. Even tried the extra DB trick and import the necessary tables.

Can you help? All the conversion threads are 2 years old.

-Thanks

-Philips

29 Nov 2007, 2:11 AM
#2
chuck avatar

chuck

Totally Zenned

Join Date:
Jul 2005
Posts:
255
Plugin Contributions:
0

Re: Problems importing osc database

cannot ... get a green light on an importBy "green light" are you using that as a figure of speech? or something more literal?

What exactly isn't working after your import?

Quite a lot more info would be needed to help sort things out ...

29 Nov 2007, 2:12 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problems importing osc database

What version osC are you coming from?

What add-ons are you using?

Did you try running a clean install of Zen Cart ... then dump the database, load the osC database and run the Upgrade?

29 Nov 2007, 5:48 AM
#4
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

Green light was actually a literal meaning for the Green text after a successful SQl upload.

OSC version 2.2.

Zen Cart version is 1.3.7.

So, if I just change my 2 include/config files to talk to my OSC DB and then click update, that should get me farther than now?

I don't mind losing any other changes but having all the products and categories would be sweet.

Thanks I'll try it.

29 Nov 2007, 5:50 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problems importing osc database

Any add-ons? or pure osC 2.2 ...

29 Nov 2007, 5:52 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: Problems importing osc database

webskipper:

Green light was actually a literal meaning for the Green text after a successful SQl upload.So, you're saying that whatever you did to massage your osc data in preparation for importing ... doesn't work because when you try to import, phpMyAdmin fails to do the import?

That would suggest that either:

  • your SQL file that you're trying to load is too large for the job to complete before PHP times out
    or
  • something you've done is causing MySQL errors ... which one would expect that phpMyAdmin would display on the screen so you have an idea what's wrong.

Did you follow the recommended import instructions?
FAQ articles available in this page: https://www.zen-cart.com/tutorials/index.php?article=153

29 Nov 2007, 7:17 AM
#7
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

"Did you follow the recommended import instructions?"

Yes. The zen.sql was fortified with the categories from osc.

I only tried it with all category tables.

The way to import is to find the zen.sql right?

OSC version is 2.2 with a lot of mods, I have a fresh copy of Zen installed. i deleted the zen db and cart and started over just this moment. That's why I have been absent.

I did try to tell the Zen cart to talk to the OSC DB through the config files and also by uploading the OSC db onto the zen DB and neither worked.

I am sorry that I do not remember the phpadmin errors.

29 Nov 2007, 7:59 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: Problems importing osc database

webskipper:

I only tried it with all category tables.When you say "all category tables" ... what are those tables? And which fields did you have in your import sql?
Were your INSERT statements using explicit column/field names, or were they general? Explicit is safest -- if you name the columns, there is less chance for error.

Posting the first 50-100 lines of your import script (you called it zen.sql) might be a help.

webskipper:

I am sorry that I do not remember the phpadmin errors.Surely they're re-creatable, right?

29 Nov 2007, 5:46 PM
#9
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

There are only 2 category tables to mention:
zen_categories
zen_categories_description

I selected the Zen DB, clicked Structure, export, highlighted the 2 category fields, selected everything under SQL options except Structure and Complete inserts and saved AS. This is what I get.

--- phpMyAdmin SQL Dump
-- version 2.10.2
-- http://www.phpmyadmin.net

-- Host: localhost:3306
-- Generation Time: Nov 29, 2007 at 09:35 AM
-- Server version: 4.0.16
-- PHP Version: 4.4.1

SET FOREIGN_KEY_CHECKS=0;

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

SET AUTOCOMMIT=0;
START TRANSACTION;

--
-- Database: zenned_p_os2

--
-- Dumping data for table zen_categories

--
-- Dumping data for table zen_categories_description

SET FOREIGN_KEY_CHECKS=1;

COMMIT;

Now, when I do the same to the OSC DB and then compare them, all it looks like I have to do is copy and paste the:

INSERT DELAYED IGNORE INTO categories (categories_id, categories_image, parent_id, sort_order, date_added, last_modified) VALUES
(1, 'KYO3021B.jpg', 0, 0, '2007-03-20 20:33:09', '2007-03-21 17:23:01'),
(2, 'clear.gif', 0, 0, '2007-03-20 20:33:09', '2007-08-03 21:32:14'),
(3, 'clear.gif', 0, 0, '2007-03-20 20:33:09', '2007-08-08 21:43:53'),
(25, 'futk6900-175.jpg', 23, 0, '2007-03-21 21:16:56', NULL),

and the rest into the appropriate area. I also tried a script someone (merlin) wrote to just insert in the SQL and run it. I did not see anything change. What's porting in programming terms?

Thanks for your help.

29 Nov 2007, 5:58 PM
#10
drbyte avatar

drbyte

Sensei

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

Re: Problems importing osc database

"zen_categories" vs "categories" ... those are different table names.

Why are you using "zen_categories" in one place and "categories" in another?

Is your Zen Cart database set up to use "zen_" prefixes on all the table names? (ie: DB_PREFIX setting in your configure.php files.)

29 Nov 2007, 6:13 PM
#11
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

"Is your Zen Cart database set up to use "zen_" prefixes on all the table names?"

Yes, no good?

29 Nov 2007, 7:29 PM
#12
drbyte avatar

drbyte

Sensei

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

Re: Problems importing osc database

Using "zen_" prefixes is fine ... as long as you're consistent.

Are you really using "categories" instead of "zen_categories" in your zen.sql import? If so, then I'm not surprised that you're not seeing the data in Zen Cart ... because you're not loading it into your Zen Cart tables.

29 Nov 2007, 7:36 PM
#13
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

I take that back.

Yes Zen_ is used for all.

zen_banners_history
zen_categories
zen_categories_description

Where do I go now?

29 Nov 2007, 7:38 PM
#14
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

I believe this is what we wanted.

-- phpMyAdmin SQL Dump
-- version 2.10.2
-- http://www.phpmyadmin.net

-- Host: localhost:3306
-- Generation Time: Nov 29, 2007 at 11:33 AM
-- Server version: 4.0.16
-- PHP Version: 4.4.1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: zen_p_os2


--
-- Table structure for table zen_categories

CREATE TABLE zen_categories (
categories_id int(11) NOT NULL auto_increment,
categories_image varchar(64) default NULL,
parent_id int(11) NOT NULL default '0',
sort_order int(3) default NULL,
date_added datetime default NULL,
last_modified datetime default NULL,
categories_status tinyint(1) NOT NULL default '1',
PRIMARY KEY (categories_id),
KEY idx_parent_id_cat_id_zen (parent_id,categories_id),
KEY idx_status_zen (categories_status),
KEY idx_sort_order_zen (sort_order)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

--
-- Dumping data for table zen_categories


--
-- Table structure for table zen_categories_description

CREATE TABLE zen_categories_description (
categories_id int(11) NOT NULL default '0',
language_id int(11) NOT NULL default '1',
categories_name varchar(32) NOT NULL default '',
categories_description text NOT NULL,
PRIMARY KEY (categories_id,language_id),
KEY idx_categories_name_zen (categories_name)
) TYPE=MyISAM;

--
-- Dumping data for table zen_categories_description

29 Nov 2007, 8:00 PM
#15
drbyte avatar

drbyte

Sensei

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

Re: Problems importing osc database

Right. And your INSERT statements need to use the zen_ tablenames as well.

29 Nov 2007, 8:15 PM
#16
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

Sorry. Where do I see an insert?

Do you zen via phone? My bill.

29 Nov 2007, 8:24 PM
#17
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

Ok. I retried the import through SQl and got a:

Fatal error: Call to a member function on a non-object in /home/-/public_html/-/includes/classes/category_tree.php on line 68

"Call a member"

When clicking on "All products" in the store.

29 Nov 2007, 11:55 PM
#18
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

Ok no fatal errors now.

Still want to import.

30 Nov 2007, 12:15 AM
#19
drbyte avatar

drbyte

Sensei

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

Re: Problems importing osc database

Following the FAQ ... you have data that you want to import.
You modified the table structure of your "old" data.
You then exported the data to a file which you said you called "zen.sql".

Right?

Backing up a step ... you modified the table structure ... but did you change the table "name" to match your Zen Cart database's table name?

ie: rename your old "categories" table to "zen_categories" (since you have decided to use "zen_" as a table prefix.

After you rename the tables you're exporting, do your export. Then try to import the data to your new database you plan to use for Zen Cart.

Otherwise you're just importing all your data into a table that Zen Cart will never see.

30 Nov 2007, 2:00 AM
#20
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Problems importing osc database

Ok. I tried that a few times and i don't see new categories or products.

Do you want to do this since I am not getting it?

I just deleted and created the ZN db one last time.

I'm afraid that I'll just have to plug each product in one at a time.