Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2010
    Posts
    9
    Plugin Contributions
    0

    Default Importing Data from Old Zen Database

    I have been building a new zen cart in a subdirectory and am now ready to launch this 'new' site.

    However, as I didnt want to cause any issues/disruption with the live site (in the root of the domain), the sub domain site is using a new database. Now, i need to take all the data from the original database and dump it into the 'new' database without affecting any of the tables etc as I have made updates/added mods and dont want to stop them working.

    Does anyone know of a way to do this? I was originally looking at the Export/Import options within myphpadmin but not sure if this would amend/affect the structure of the existing tables/database?

    Anyone have any ideas/pointers?

    Thanks in advance.

    ----------------------------------------------
    As a side note i did actually import data on 04OCT2011 so that i had products etc showing (so i could see what everything would look like) but am not overly sure if it would end up being a harder task to just import customers/new products etc added since that date, or just try to import the whole of the original database)
    ---------------------------------------------

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Importing Data from Old Zen Database

    You have to be careful with databases.

    While it's not that clear as to how you have set things up ... or the CHRONOLOGY of how you have done things ... or whether your OLD and NEW sites are the same version ... or whether you have added mods to the NEW version that are not on the OLD version (and/or vice versa)....

    ... the main thing to bear in mind is to understand the RELATIONSHIP between the database and its corresponding shop's code files.

    In general, and because the database live SEPARATELY from the code ... there should be no need to copy DATA across...

    You should simply edit your configure.php files of the OLD site, to indicate the name of the NEW database.

    But as I said... the NEW database must be absolutely "compatible" with the OLD site's files, so (for example) if the NEW database contains extra data, or fields, or tables, that relate to some add-on... and the same add-on is not installed in the OLD site, you will have issues.
    20 years a Zencart User

  3. #3
    Join Date
    Nov 2010
    Posts
    9
    Plugin Contributions
    0

    Default Re: Importing Data from Old Zen Database

    Quote Originally Posted by schoolboy View Post
    You have to be careful with databases.

    While it's not that clear as to how you have set things up ... or the CHRONOLOGY of how you have done things ... or whether your OLD and NEW sites are the same version ... or whether you have added mods to the NEW version that are not on the OLD version (and/or vice versa)....

    ... the main thing to bear in mind is to understand the RELATIONSHIP between the database and its corresponding shop's code files.

    In general, and because the database live SEPARATELY from the code ... there should be no need to copy DATA across...

    You should simply edit your configure.php files of the OLD site, to indicate the name of the NEW database.

    But as I said... the NEW database must be absolutely "compatible" with the OLD site's files, so (for example) if the NEW database contains extra data, or fields, or tables, that relate to some add-on... and the same add-on is not installed in the OLD site, you will have issues.

    Thanks for the reply - there has been some modification to the structure of the new DB due to additional add ons/mods....so guessing i may have to rethink my approach. The zen cart version is exactly the same - just as an FYI.

    Going to consider just importing the customers/orders that have taken place and then just manually update the products using the Excel Populate add-on.

    If all goes south then, i'll just start again and put the 'down for maintanence' option on the old site and then redirect the config.php on the NEW site to the OLD sites DB. Then add mods.

    Thanks again..

  4. #4
    Join Date
    Sep 2006
    Location
    Colorado Springs CO USA
    Posts
    516
    Plugin Contributions
    2

    Default Re: Importing Data from Old Zen Database

    Quote Originally Posted by rka81 View Post
    Thanks for the reply - there has been some modification to the structure of the new DB due to additional add ons/mods....so guessing i may have to rethink my approach. The zen cart version is exactly the same - just as an FYI.

    Going to consider just importing the customers/orders that have taken place and then just manually update the products using the Excel Populate add-on.

    If all goes south then, i'll just start again and put the 'down for maintanence' option on the old site and then redirect the config.php on the NEW site to the OLD sites DB. Then add mods.

    Thanks again..
    Installing add-ons rarely disturb existing data in your database. Some, needing to store data related to the add-on simply create additional tables in the database and do not affect existing data. When data must be added or changed in existing tables, most add-on's provide the sql script to accomplish this.

    Here is a simple method which should work:
    Always backup both the website files and the mySql database files of both the old and new version of your website before you start.

    In this case I am suggesting you simply replace the old Zencart files with the new ones from your subdomain so that your website keeps the same url.

    1. Copy your backup of your subdomain into your existing webroot (in otherwords, copy them over your current website files.) Make sure the includes/configure.php and admin/includes/configure.php permissions are set to "read only" (-r-r-r- or 444) on the current site. This will prevent replacing these files with those from the subdomain (you must retain the configuration settings of the current website.) As a precaution, you might also want to rename these files in the subdomain backup before copying the fileset to the main domain).

    So to review: you are going to copy your fileset from the subdomain into the main domain but retain the two configure.php files of the existing website.

    2. You will continue to use the existing database associated with the current website on the main domain. Check the installation files of the add-ons that were added to the subdomain for any sql files and run them on the main domain. Do not run sql files for add-ons that pre-existed on the main domain. This will update your existing database for the add-on features.

    3. If some of the add-ons required you to make settings in admin after running the sql files, then you should check and re-enter those settings.
    www.aspenshopsonline.com - ZenCart 1.3.9h
    www.wilkssupply.com - ZenCart 1.3.9h
    www.un-du.net - ZenCart 1.3.8a

 

 

Similar Threads

  1. v139h Database problem - not all data is importing from DB copy
    By shags38 in forum General Questions
    Replies: 4
    Last Post: 28 Feb 2015, 11:22 AM
  2. Replies: 1
    Last Post: 9 Jan 2015, 05:57 AM
  3. Error importing old database to the new database
    By wmorris in forum Upgrading to 1.5.x
    Replies: 1
    Last Post: 3 Jan 2012, 08:27 AM
  4. Replies: 4
    Last Post: 15 Oct 2010, 07:18 AM
  5. Replies: 10
    Last Post: 7 Oct 2009, 05:16 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR