Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,673
    Plugin Contributions
    1

    Default Database problem - not all data is importing from DB copy

    I am currently doing my first version upgrade from 1.3.9h to 1.5.1 and am at the stage of importing database from existing working site into the test site - everything to do with products and product categories data is not loading into the test site database - address book, admin pages, and others have loaded but not the ones mentioned (as well as others).
    When importing the db I got an error message about duplicate addresses so I copied the original db minus address book - then after importing I got another error about address format so copied original db minus that as well and imported it however was still getting errors.

    I have tried copying just certain sections for importing to test db - the latest was I copied categories, category descriptions, products, product descriptions - received error message saying duplicate entry for categories (see below) - in checking that section the data was actually there as was category description however products and product description were not.

    Is there some reason for this occurring? are there permissions I need to adjust or something else? I figure after the last attempt mentioned that if I was to export then import only one data set at a time I will eventually get there but I have 4 other sites to upgrade so there is either something I am doing wrong or something I haven't done.

    cheers, Mike

    Error

    SQL query:

    --
    -- Dumping data for table `categories`
    --
    INSERT INTO `categories` ( `categories_id` , `categories_image` , `parent_id` , `sort_order` , `date_added` , `last_modified` , `categories_status` )
    VALUES ( 1, NULL , 0, 0, '2012-09-06 18:03:38', '2013-04-30 14:30:41', 1 ) , ( 2, NULL , 0, 1, '2012-09-06 18:04:08', '2014-07-30 17:33:38', 1 ) , ( 3, NULL , 0, 2, '2012-09-06 18:04:35', '2014-07-30 11:23:14', 1 ) , ( 4, NULL , 0, 3, '2012-09-06 18:05:05', '2013-04-30 14:31:42', 1 ) , ( 6, NULL , 0, 5, '2012-09-06 18:06:05', '2014-07-04 08:58:26', 1 ) , ( 7, NULL , 0, 6, '2012-09-06 18:06:26', NULL , 1 ) , ( 8, NULL , 0, 3, '2013-04-30 14:29:08', NULL , 1 ) , ( 9, NULL , 0, 9, '2013-04-30 15:24:09', '2013-04-30 15:24:27', 1 ) , ( 10, NULL , 0, 5, '2013-05-14 10:07:56', '2013-05-14 10:08:19', 1 ) , ( 11, NULL , 0, 3, '2013-06-28 10:02:15', '2014-07-13 09:25:56', 1 ) ;

    MySQL said: Documentation
    #1062 - Duplicate entry '1' for key 'PRIMARY' <<<<<<<<<<<<<< same message in every case

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,925
    Plugin Contributions
    96

    Default Re: Database problem - not all data is importing from DB copy

    When you created the database export, I'm thinking that you didn't check the Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement option under the Object creation options.

  3. #3
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,673
    Plugin Contributions
    1

    Default Re: Database problem - not all data is importing from DB copy

    Quote Originally Posted by lat9 View Post
    When you created the database export, I'm thinking that you didn't check the Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement option under the Object creation options.
    Spot on ...... Many thanks !!

  4. #4
    Join Date
    Jan 2004
    Posts
    66,445
    Plugin Contributions
    81

    Default Re: Database problem - not all data is importing from DB copy

    For future reference, this FAQ article mentions that: http://www.zen-cart.com/content.php?...atabase-backup
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Database problem - not all data is importing from DB copy

    Quote Originally Posted by shags38 View Post
    I have tried copying just certain sections for importing
    You need to be very careful when importing the data 'in sections'. If you fail to import all of the related tables you can get some rather unpredictable and nasty behaviour.

    Unless you have a very good reason to do this it is much safer (and easier) to drop and re-import the entire database. That way you can be sure that everything maintains its relationships with everything else.

    Just sayin'

    Cheers
    RodG

 

 

Similar Threads

  1. Importing Data from Old Zen Database
    By rka81 in forum General Questions
    Replies: 3
    Last Post: 19 Oct 2011, 07:57 AM
  2. Problem zencart does not copy all atributes
    By mrbert in forum General Questions
    Replies: 1
    Last Post: 9 Jun 2007, 02:12 AM
  3. Html editor language problem after importing database content from backup
    By stregoi in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Apr 2007, 10:51 PM
  4. Not getting new data from database
    By StevenB in forum General Questions
    Replies: 0
    Last Post: 16 Apr 2007, 02:18 AM
  5. Help importing data into database...
    By dbunch in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 18 Jan 2007, 11:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg