Jump to content

Import


Guest ByondF1

Recommended Posts

Guest ByondF1

Is there any kind of import available for loading your site. I have over 1000 products and it is going to take me forever to get my gatalog populated.

I really hope there is one. I can format the data in just about any format but need a program to import it into the databases.

Thanx in advance.

Link to comment
Share on other sites

Guest estelle

Do you have access to phpMyAdmin, or some way of running SQL commands on your server?

I have my inventory, categories, and links between products and categories all setup a spreadsheet. I then save/export these three spreadsheets as CSV files and run the following SQL commands on my server to delete and repopulate the whole of my categories/products. This LOAD DATA LOCAL INFILE command means that phpMySQL will retrieve the file from your local machine and send it to the server. Pretty hand :). Or if this isn't working, take out the LOCAL and first FTP the files to your server.

Modify wherever necessary (refer to www.mysql.com), and use at your own risk :D...

TRUNCATE TABLE --xxx--_CubeCart_category;

LOAD DATA LOW_PRIORITY LOCAL INFILE 'C:/Documents and Settings/--xxx--/My Documents/--xxx--/categories.csv'

    INTO TABLE --xxx--_CubeCart_category

    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'

    LINES TERMINATED BY '\r\n' STARTING BY ''

    IGNORE 1 LINES;



TRUNCATE TABLE --xxx--_CubeCart_inventory;

LOAD DATA LOW_PRIORITY LOCAL INFILE 'C:/Documents and Settings/--xxx--/My Documents/--xxx--/inventory.csv'

    INTO TABLE --xxx--_CubeCart_inventory

    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'

    LINES TERMINATED BY '\r\n' STARTING BY ''

    IGNORE 1 LINES;



-- Links

TRUNCATE TABLE --xxx--_CubeCart_cats_idx;

LOAD DATA LOW_PRIORITY LOCAL INFILE 'C:/Documents and Settings/--xxx--/My Documents/--xxx--/cat_inv_links.csv'

    INTO TABLE --xxx--_CubeCart_cats_idx

    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'

    LINES TERMINATED BY '\r\n' STARTING BY ''

    IGNORE 1 LINES;

Note: if you wanted to, you could try taking out the TRUNCATE TABLE lines, and adding REPLACE at the start of the INTO TABLE lines. This way you should just be able to add/update rows without having to replace the whole tables, but I haven't tried this yet.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...