Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2008
    Location
    Los Angeles, CA
    Posts
    82
    Plugin Contributions
    0

    Default Migrating entire site and Database

    Hello,

    I had a site built with a few products on a testing server at mysite.com/myFutureStore.
    I installed a clean new Zencart on the root of the new server myNewDomain.com and it's fine.
    Then I copied and saved the new configure files from the includes folder and admin>includes folder to my computer via FTP.
    Then I FTP'd all the old site files to the new install.
    Then I made sure to then FTP the configure files that I saved from the new install.

    So far so good... New Site works, New Admin works. Obviously no products or data, just a clean store.

    I went to PHPmyadmin for both old and new databases and make export backups of both.
    Then I selected and dropped all the tables from new database.
    Then I imported the old database to the new database.

    Then I get a blank screen with the warning: WARNING: An Error occurred, please refresh the page and try again.

    What went wrong?

    I checked the configure files and they are from the new install.

    Even if I install the fix_cache_key.php it won't let me run the page by typing in the page url mywebsite.com/fix_cache_key.php.

    Is there something I can change manually n the data base fields?

    In the past I have done a partial import of a new site without the some tables and had it work but this time I want to try and do it with a full drop and import replacement .

    Regards,
    Nadia

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Migrating entire site and Database


  3. #3
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Migrating entire site and Database

    Let us know what you find.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Sep 2008
    Location
    Los Angeles, CA
    Posts
    82
    Plugin Contributions
    0

    Default Re: Migrating entire site and Database

    I checked my logs and the first thing I saw was:

    Code:
    [04-Apr-2014 21:25:35 UTC] PHP Fatal error:  1146:Table 'frozensol_zc1.zc_configuration' doesn't exist :: select configuration_key as cfgkey, configuration_value as cfgvalue
                                     from zc_configuration in /home/frozensol/public_html/includes/classes/db/mysql/query_factory.php on line 120
    So I restored the new install database and then dropped all the tables except configure. Then Imported the old database (without the configure table).

    Then It still had the same blank(ish) page and I checked the logs again and now have this:

    Code:
    [04-Apr-2014 21:57:05 UTC] PHP Fatal error:  1146:Table 'frozensol_zc1.zc_product_type_layout' doesn't exist :: select configuration_key as cfgkey, configuration_value as cfgvalue
                              from zc_product_type_layout in /home/frozensol/public_html/includes/classes/db/mysql/query_factory.php on line 120

  5. #5
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Migrating entire site and Database

    Quote Originally Posted by NadiaUSA View Post
    I checked my logs and the first thing I saw was:

    Code:
    [04-Apr-2014 21:25:35 UTC] PHP Fatal error:  1146:Table 'frozensol_zc1.zc_configuration' doesn't exist :: select configuration_key as cfgkey, configuration_value as cfgvalue
                                     from zc_configuration in /home/frozensol/public_html/includes/classes/db/mysql/query_factory.php on line 120
    So I restored the new install database and then dropped all the tables except configure. Then Imported the old database (without the configure table).

    Then It still had the same blank(ish) page and I checked the logs again and now have this:

    Code:
    [04-Apr-2014 21:57:05 UTC] PHP Fatal error:  1146:Table 'frozensol_zc1.zc_product_type_layout' doesn't exist :: select configuration_key as cfgkey, configuration_value as cfgvalue
                              from zc_product_type_layout in /home/frozensol/public_html/includes/classes/db/mysql/query_factory.php on line 120
    Do your current configure.php files (new ones) have the table prefix zc_ ?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Sep 2008
    Location
    Los Angeles, CA
    Posts
    82
    Plugin Contributions
    0

    Default Re: Migrating entire site and Database

    Ah, strangley the new database tables prefix is zc_ and the old is zen_

    How do I fix this?

  7. #7
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Migrating entire site and Database

    Quote Originally Posted by NadiaUSA View Post
    Ah, strangley the new database tables prefix is zc_ and the old is zen_

    How do I fix this?
    Either use sql to alter all of the tables in the new database after import of all the tables, or modify the configure.php files to have the database prefix as zen_ instead of zc_.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Sep 2008
    Location
    Los Angeles, CA
    Posts
    82
    Plugin Contributions
    0

    Default Re: Migrating entire site and Database

    YAY! I just changed the database prefix in the 2 configure files and did a new clean dump and import.

    I didn't catch it was zc_ instead of zen_

    Thanks!!!!!!!!!!!!!!!!

  9. #9
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Migrating entire site and Database

    Quote Originally Posted by NadiaUSA View Post
    YAY! I just changed the database prefix in the 2 configure files and did a new clean dump and import.

    I didn't catch it was zc_ instead of zen_

    Thanks!!!!!!!!!!!!!!!!
    Glad you figured it out. Sorry that I identified the incorrect new/old configure.php file to look in for the prefix of zc_

    To clarify for anyone that has happened across this thread in search of a solution, the OP had setup a new store and new database (ZC default) then brought all files from the old store and the database contents from the old store to the new store minus the two old configure.php files.

    Generally speaking there would be no problem with that process; however, in creating the new store, a table prefix was applied that was different than the old store's table prefix. (Btw, ZC default/recommendation is to not include a prefix which would have completely prevented this problem, but we each have our reasons to have one or not.)

    So, with the configure.php files expecting a prefix of zc_ and the database tables having a prefix of zen_, the code could not access the correct table information.

    The tests that NadiaUSA did by not replacing the "problem" table one time identified that the new store accepted the new database structure for the one table, but didn't like the next table. This identified that the table structure was in question (table name(s)) I then referenced the prefix of the wrong store, but NadiaUSA was able to figure it out. That is/was also something covered in the link provided by stevesh which summed up everything I could think to ask. :)

    Anyways, glad it's working for you now. :) happy Zenning!
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Fast and Easy Checkout for Zen Cart - broke my entire site
    By finlander in forum Addon Payment Modules
    Replies: 2
    Last Post: 29 Nov 2010, 03:59 PM
  2. Replies: 1
    Last Post: 30 Oct 2008, 10:13 AM
  3. migrating database to new shop
    By styledata in forum General Questions
    Replies: 5
    Last Post: 16 Jul 2007, 01:03 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