Reset product id - HOW?

I would like to reset all the product ids to make it looks better as currently, it starts from like 3xxx. I would like to reset it back to 1 and re-import them from csv.



Please show me what to do if you know how to



Thanks



rommy

You’ll need to access your MySQL DB with a tool like PHPmyadmin. View the table you want to reset and click on the Operations tab. Look for the field “AUTO_INCREMENT” and change the value there to 1.



Glen

[quote name=‘sixnin9’]You’ll need to access your MySQL DB with a tool like PHPmyadmin. View the table you want to reset and click on the Operations tab. Look for the field “AUTO_INCREMENT” and change the value there to 1.



Glen[/QUOTE]



That won’t solve his problem of resetting the existing product_id’s.

The first question I would ask is why do you want to rest the product_id’s? They are not displayed and are used as a primary key in the DB only. Is it the product_code that you want to change? There are many relationships in the db based on product_id. I would suggest that unless you really understand all aspects of the core schema (and all the addons that relate to it) that you leave the primary key alone.

Thank you for all your answer.



I wanna reset the product id because I’ve been playing around with the dummy data and I now wanna reset all the id starting from 1 before importing the actual products. I dont like the look of my product’s id starting from something like 3xxx



Obviously, i have to delete all the dummy data before importing the actual ones.

Where are you “seeing” your product_id’s? I don’t know of anywhere they are visible in the cart.

[quote name=‘tbirnseth’]Where are you “seeing” your product_id’s? I don’t know of anywhere they are visible in the cart.[/QUOTE]



oh well…you can see it when you move your mouse over the each product and the id will show in the status bar of your browser. Also, when you do importing

[quote name=‘rommy’]Thank you for all your answer.



I wanna reset the product id because I’ve been playing around with the dummy data and I now wanna reset all the id starting from 1 before importing the actual products. I dont like the look of my product’s id starting from something like 3xxx



Obviously, i have to delete all the dummy data before importing the actual ones.[/QUOTE]



I would say that you shouldn’t just delete the dummy data, you should drop the tables (using something like phpMyAdmin), and re-create them. This will start the auto-increment values from 1.



Also, after you’ve done that, if you want the products should be in a specific order, sort them in the CSV file before importing.

Don’t drop the table, truncate/empty the table so the fields will remain intact.


truncate table "table_name" ;



Then you will need to reset auto_increment.


alter table "table_name" auto_increment= 0 ;

[quote name=‘The Tool’]Don’t drop the table, truncate/empty the table so the fields will remain intact.


truncate table "table_name" ;



Then you will need to reset auto_increment.


alter table "table_name" auto_increment= 0 ;[/QUOTE]



This worked for me. Had the same issue. My csv had the product options included and I wanted to reset the product_id…Seems like the product options get mixed up when you have different product id’s…Anyway, this worked! Thanks The Tool :slight_smile: