.
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.
The Old Config - Exported:
// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', '');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'paragon1');
define('DB_SERVER_PASSWORD', 'xxxxxxx');
define('DB_DATABASE', 'paragon1_HHDSTORE');
define('USE_PCONNECT', 'false'); // use persistent connections?
define('STORE_SESSIONS', 'db'); // use 'db' for best support, or '' for file-based storage
The new Config - Imported:
// define our database connection
define('DB_TYPE', 'mysql');
define('DB_PREFIX', 'zen_');
define('DB_SERVER', 'localhost');
define('DB_SERVER_USERNAME', 'hhetc_zc1');
define('DB_SERVER_PASSWORD', 'xxxxxxxxx');
define('DB_DATABASE', 'hhetc_zc1');
define('USE_PCONNECT', 'false'); // use persistent connections?
define('STORE_SESSIONS', 'db'); // use 'db' for best support, or '' for file-based storage
Again, all of the data is in the imported database and viewable via phpmyadmin. The store does not display the contents when viewed though.
Last edited by MagicMan; 14 Dec 2007 at 05:40 PM. Reason: add on comments
Right, and that's to be expected, since you've got it pointing to the wrong tables in your database:
a) Your old database has no "prefixes" on the table names.
b) Your new database has "zen_" as a prefix before each table name.
c) If you imported the "old" database w/o prefixes into your "new" database, you'll see that you have two sets of tables ... one w/o prefixes, and one with.
Just scroll down the list of tables, and you'll see a complete extra set that start with "zen_".
So, you need to do two things:
1. edit your 2 configure.php files, and set the DB_PREFIX to '' (two single quotes)
2. use phpMyAdmin and manually delete all the tables starting with "zen_".
Be careful you don't delete other tables starting with the letter Z by mistake.
.
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.
Is there a way that I can do the opposite. Transfer the empty table with the data and rename it to Zen, so that I do not have to go through this again in the future and because I also have 2 other sites that are configured properly and I would like to keep everything symetrical and easy to use.
If you learn how to do installs on your own, you'll be able to set up new sites as you want them to be.
I recommend *not* using "zen_" prefixes. "No prefix" is much less complicated.
I'm not sure what's "complicated" about correcting the DB_PREFIX to match what's needed in your database ... esp since you've got to edit the configure.php files for a move anyway.
.
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.
I got it.
Yes, I do know how to do a manual installation it just seemed so much easier to do it through CPanel.
Can I just FTP a backup copy of the original install to my new server?
If I do this I think I still need to load the Install file and do an installation over before I import the database. Yes?
Bye the way, thank you for taking the time to discuss this with me it is greatly appreciated..
Much like the FAQ I referenced earlier, yes.
1. FTP the files to the server
2. PROTECT ... make a backup of ... BOTH configure.php files, and mark the uploaded ones as read-write
3. Ensure that the zc_install folder is also uploaded (and matches the version of the Zen Cart files you're using)
4. Run zc_install to set up the database and build configure.php files specific to the new server, being sure to use the same DB_PREFIX.
5. Import the database backup into the new database.
6. Login to the admin and fix the session directory, as per the FAQ.
Basically ... just follow the FAQ :)
.
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.
I resolved the issues. Thank you so much for your assistance. Everything is working fine. Everyone in this forum is top knotch and should be proud of yourselves. Outstanding job.
Thread can be closed
Here's additional info in case it helps someone.
You may or may not consider doing it this way, as you've already begun fidgeting with the configure.php files.... This works well if you are looking to copy over products, categories, customers, attributes, etc. If you are looking to copy the entire database, then you may as well do just that.
With a fresh install of Zencart, here's what I do.
FIRST, DO A BACKUP: in phpMyAdmin. Select your old database that is storing all of your info. Click Export on the top. Click "Select All" (or make sure all the fields in the box are highlighted in the Export box) Leave it as a SQL export type. Check "Save As" and click Go. This makes a SQL backup of your precious database.
THEN: Install Zencart fresh. Link it to an entirely new database.
Say the original was called Zen1.
Call the new install database Zen2 (created of course before the install)
You'll have 93 tables by default in your new installed database, but no products or categories, right?
In phpMyAdmin, click on your old database. Click products. Click Operations. Somewhere there you will see "Copy table to (database.table):"
In the drop down, select the new database name as that's where you want to copy to.
In the empty text field after the . type the word products
NOTE: what you type in this field must match exactly the name of the table you are copying.
Click "data only". (as you only want the data. The structure means the "table" itself & that already exists.)
Click "go"
The product data will be copied.
NOTE: If you have existing data in your product table in your new database because you added a product to test it out or whatever, you will not be able to copy over data from the old database to the new. It will error.
If the data in the new database in the "product" table is not important, then delete it and make the table empty so it's ready for the copy over process.
To empty a table: Select the database that contains the table.Then click on the table from the list to the right. At the top you can click "Browse" just to take a look at what's in there to make sure you are cool with deleting it. If so, Click "Empty" at the top. Say Ok to any prompting. Then the table will be empty & you can copy data to it no problem.
To copy over products & categories from an old database to a new database,
you need to copy over AT LEAST these 5 tables:
products
products_description
products_to_categories
categories
categories_description
IF your products had attributes, then you also need to copy over these tables as well:
products_attributes
products_options
products_options_values
products_options_values_to_products_options
If you want to copy the entire database over, even easier.
Make sure you have the backup from above. Make 2 backups if you're totally concerned.
Next destroy the new databse you just installed the ZenCart to, in my example above "zen2"
How to do that: if you don't have a "destroy" option in PhpMyAdmin (next to "Empty" up top), then in your MySql server, delete the databse zen2 (the NEW one, NOT the one holding your databse). Re-create a database again WITH THE EXACT SAME NAME. I mean exact. Now you have a totally empty databse called Zen2.
Go back to phpMyAdmin. Click the new (now empty) database "Zen2". Clck "Import" from the top. Browse to your SQL backup. Click go. It may take a few seconds & voila. There it is.
If you need further assistance, just ask. I am very familiar with importing / exporting to zencart.
hope this helps.
Hi there
Just starting this thread again as I have a simple question which I hope that someone will be able to help me with. My question is in regard to the this thread however, I need to know;
if i can import a database which is for zen version 1.3.7.1 into a database for a fresh install of zen version 1.3.8a?
If this is possible, I am guessing that i would have to re-upload the zc_install directory for version 1.3.8a and then run the install and choose update database.
Could someone please be kind enough to either confirm my thoughs or correct me if I am wrong.
Waiting in anticipation