Advertisement:

Author Topic: XML category import/export problem  (Read 4325 times)

data99

  • Full Member
  • ***
  • Posts: 180
XML category import/export problem
« on: April 12, 2015, 02:06:06 am »

Hello. I have installed XML category import/export plugin. I can see the configuration but I it doesnt work. I use Osclas 3.5
For Importing the XML file I can choose the file but it doesnt want to load. And in export case I click on export but it doesn't do anything...

Has anyone got solution for this problem

data99

  • Full Member
  • ***
  • Posts: 180
Re: XML category import/export problem
« Reply #1 on: April 23, 2015, 02:44:10 am »
im using 3.5.6 the latest .. any suggestion how do I copy from one website to another

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: XML category import/export problem
« Reply #2 on: April 23, 2015, 01:24:13 pm »
***CORRECTED***

Hi,

Don't know that plugin, but category tables are pretty simple to export/import using PhpMyAdmin;

1.- Enter your source database and click on Export at the top.

2.- On the next page, you need to check "Custom - display all possible options", you'll see a lot of options:

     2a.- Table(s): Select only t_category and t_category_description

     2b.- Format-specific options:

          Disable foreign key checks -> Checked (This to avoid error messages regarding foreign keys constraints.)

          Check "Add DROP TABLE statement"

     2c.- Go and save to disk.

3.- Enter your destination database and click on Import.

That should do it, regards.
« Last Edit: April 23, 2015, 09:15:02 pm by teseo »

data99

  • Full Member
  • ***
  • Posts: 180
Re: XML category import/export problem
« Reply #3 on: April 23, 2015, 06:17:32 pm »
Thanks for the reply but I get this error on import


Code: [Select]
--
-- Dumping data for table `oc_t_category`
--

INSERT INTO `oc_t_category` (`pk_i_id`, `fk_i_parent_id`, `i_expiration_days`, `i_position`, `b_enabled`, `b_price_enabled`, `s_icon`) VALUES
(1, NULL, 0, 17, 1, 1, NULL),
(2, NULL, 0, 18, 1, 1, NULL),
(3, NULL, 0, 10, 1, 1, NULL),
(4, NULL, 0, 9, 1, 1, NULL),
(5, NULL, 0, 4, 1, 1, NULL),
(6, NULL, 0, 19, 1, 1, NULL),
(7, NULL, 0, 20, 1, 1, NULL),
(8, NULL, 0, 6, 1, 1, NULL),
(9, 1, 0, 1, 1, 1, NULL),
(10, 1, 0, 2, 1, 1, NULL),
(11, 1, 0, 3, 1, 1, NULL),
(12, 1, 0, 4, 1, 1, NULL),
(13, 1, 0, 5, 1, 1, NULL),
(14, 1, 0, 6, 1, 1, NULL),
(15, 1, 0, 7, 1, 1, NULL),
(16, 1, 0, 8, 1, 1, NULL),
(17, 1, 0, 9, 1, 1, NULL),
(18, 1, 0, 10, 1, 1, NULL),
(19, 1, 0, 11, 1, 1, NULL),
(20, 1, 0, 12, 1, 1, NULL),
(21, 1, 0, 13, 1, 1, NULL),
(22, 1, 0, 14, 1, 1, NULL),
(23, 1, 0, 15, 1, 1, NULL),
(24, 1, 0, 16, 1, 1, NULL),
(25, 1, 0, 17, 1, 1, NULL);

MySQL said: Documentation
#1062 - Duplicate entry '1' for key 'PRIMARY'

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: XML category import/export problem
« Reply #4 on: April 23, 2015, 06:55:34 pm »
I see... I guess you already have categories in the destination database.Your goal, is it to add new categories to an already existent set of them or to replace existent ones entirely? ???

Regards


ashish1241

  • Jr. Member
  • **
  • Posts: 59
Re: XML category import/export problem
« Reply #5 on: April 23, 2015, 08:49:41 pm »
Hey I got the same error. I don't have any categories already created, where I want to Import the Categories
Please Help

ashish1241

  • Jr. Member
  • **
  • Posts: 59
Re: XML category import/export problem
« Reply #6 on: April 23, 2015, 08:51:00 pm »
This is the error : SQL query:

-- -- Dumping data for table `osc_t_category` -- INSERT INTO `osc_t_category` (`pk_i_id`, `fk_i_parent_id`, `i_expiration_days`, `i_position`, `b_enabled`, `s_icon`, `b_price_enabled`) VALUES (1, 14, 0, 12, 1, NULL, 1), (2, 14, 0, 5, 1, NULL, 1), (3, 14, 0, 6, 1, NULL, 1), (4, 14, 0, 7, 1, NULL, 1), (5, 14, 0, 4, 1, NULL, 1), (6, 14, 0, 1, 1, NULL, 1), (7, 14, 0, 2, 1, NULL, 1), (8, 14, 0, 8, 1, NULL, 1), (9, 14, 0, 9, 1, NULL, 1), (10, 14, 0, 11, 1, NULL, 1), (11, 14, 0, 0, 1, NULL, 1), (12, 14, 0, 3, 1, NULL, 1), (13, 14, 0, 10, 1, NULL, 1), (14, NULL, 0, 3, 1, NULL, 0), (15, 30, 0, 13, 1, NULL, 1), (16, 30, 0, 12, 1, NULL, 1), (17, 30, 0, 14, 1, NULL, 1), (18, 30, 0, 10, 1, NULL, 1), (19, 30, 0, 9, 1, NULL, 1), (20, 30, 0, 8, 1, NULL, 1), (21, 30, 0, 7, 1, NULL, 1), (22, 30, 0, 6, 1, NULL, 1), (23, 30, 0, 5, 1, NULL, 1), (24, 30, 0, 4, 1, NULL, 1), (25, 30, 0, 3, 1, NULL, 1), (26, 30, 0, 2, 1, NULL, 1), (27, 30, 0, 1, 1, NULL, 1), (28, 30, 0, 0, 1, NULL, 1), (29, 30, 0, 11, 1, NU[...]

MySQL said: Documentation

#1062 - Duplicate entry '1' for key 'PRIMARY'

data99

  • Full Member
  • ***
  • Posts: 180
Re: XML category import/export problem
« Reply #7 on: April 23, 2015, 09:05:55 pm »
no I deleted all category from admin panel but still get error while deleting

SQL query:

DELETE FROM `oddclass_adminji`.`oc_t_category` WHERE `oc_t_category`.`pk_i_id` = 1

MySQL said: Documentation
#1451 - Cannot delete or update a parent row: a foreign key constraint fails (`oddclass_adminji`.`oc_t_category`, CONSTRAINT `oc_t_category_ibfk_1` FOREIGN KEY (`fk_i_parent_id`) REFERENCES `oc_t_category` (`pk_i_id`))

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: XML category import/export problem
« Reply #8 on: April 23, 2015, 09:17:48 pm »
Yes, review now my above post. Under section 2b, look at the new "Add DROP TABLE statement" instruction. That will empty the current table before importing (when you install Osclass it is filled with default categories, so it always has contents). And remember the Foreign key checks = Off too.

Regards
« Last Edit: April 23, 2015, 09:19:39 pm by teseo »

ashish1241

  • Jr. Member
  • **
  • Posts: 59
Re: XML category import/export problem
« Reply #9 on: April 23, 2015, 10:28:17 pm »
Let me try, will update you in a few min

ashish1241

  • Jr. Member
  • **
  • Posts: 59
Re: XML category import/export problem
« Reply #10 on: April 23, 2015, 10:39:21 pm »
After importing I get :  Import has been successfully finished, 19 queries executed. (cityehub_osc3.sql (2).zip)
but nothing show up http://ar.cityehub.com/

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: XML category import/export problem
« Reply #11 on: April 23, 2015, 10:52:40 pm »
Hi,

Can you seem them on Admin Dashboard? ???

Regards

ashish1241

  • Jr. Member
  • **
  • Posts: 59
Re: XML category import/export problem
« Reply #12 on: April 23, 2015, 11:06:30 pm »
Nope not even there

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: XML category import/export problem
« Reply #13 on: April 23, 2015, 11:19:56 pm »
Did you follow exactly the procedure described ¡n my corrected post here?:

http://forums.osclass.org/3-5-x/xml-category-importexport-problem-28767/msg120254/#msg120254

Regards

ashish1241

  • Jr. Member
  • **
  • Posts: 59
Re: XML category import/export problem
« Reply #14 on: April 23, 2015, 11:48:24 pm »
Word by word, I cross checked as well  :-\