I am looking at a new method of import that will bypass the import process but want to run it by you first.
Keep in mind I do all my imports and changes on my local computer and then upload the text files for import into PT.
I am thinking making a new installation for PT or just a copy of the products table.
What I want to do:
Create a duplicate of the products table
Create a file with the following code
require_once ('../../XXX.php');
mysql_query("DROP TABLE Nameofnewproducttable");
mysql_query("CREATE TABLE Nameofnewproducttable(
(Add all necessary columns to match existing table)
(Just examples)
prod_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
Merchant TEXT NOT NULL,
Brand TEXT NOT NULL,
BrandID VARCHAR(30) NOT NULL,
Sku VARCHAR(30) NOT NULL,
ProductName TEXT NOT NULL,
Category TINYTEXT NOT NULL,
SCategory TINYTEXT NOT NULL,
ProdGroup TINYTEXT NOT NULL,
Keywords VARCHAR (200) NOT NULL,
SCat TEXT NOT NULL,
Pgroup TEXT NOT NULL,
PRIMARY KEY (prod_id))") or die (mysql_error());
echo "ProductName table setup complete";
(Import all product from all merchants directly into table)
mysql_query("INSERT INTO prodname (Sku, ProductName)
VALUES ('XXX','XXX'),
('XXX','XXX'),
('XXX','XXX')")or die (mysql_error());
Import time is much faster
_____________________________________
Then rename tables to replace existing working table
Rename working table to table 3
Rename new table to working table
Rename table 3 to new table
My question are,
Do I need to update anything else besides the columns that are imported too with the existing script?
Which files and folders can I then eliminate with this process?
Do the products need to be in a certain order for effeciency? By merchant, by Product?
I haven't tried this yet but do you think this will work?
Please advise
Al
Thanks for the reminder about the create table, completely forgot about it.
I will keep you posted on how this turns out. Maybe you can it for other users. I will have to see how it works with a large file like that.
Hi Al,
Did you know you can use CREATE TABLE newtable LIKE oldtable? That should make the creation of the temporary table easy. I'm actually looking into something very similar for another user at the moment. The main caveat is that all products must be imported at the same time.
There are probably numerous files that can be removed if you achieve this, but without going into your solution in some detail it's difficult to say exactly what can be removed; however it shouldn't cause any problem leaving files in place even if they are no longer required.
Cheers,
David.