We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How do I reset the next entry_id to "1" after numerous test data imports?

How Do I?

IC360 (Oliver Cannell)'s avatar
IC360 (Oliver Cannell)
241 posts
5 years ago
IC360 (Oliver Cannell)'s avatar IC360 (Oliver Cannell)

I’ve completed lots of testing and data imports on a new site, so my entry_id values are now up into the 10,000’s. How can I reset the “next created” entry_id back to 1, now that I have deleted all my test entries?

I understand that in EE2 it could be done by editing the exp_channel_titles database table: ALTER TABLE exp_channel_titles AUTO_INCREMENT = 1

But I can’t see that data in this table on an EE5 install.

       
IC360 (Oliver Cannell)'s avatar
IC360 (Oliver Cannell)
241 posts
5 years ago
IC360 (Oliver Cannell)'s avatar IC360 (Oliver Cannell)

Solved it. In phpMyAdmin, I went to the exp_channel_titles table. I then clicked on the Operations tab. The AUTO_INCREMENT value for this table is displayed and is editable here.

I just reset the value back to what I needed, for the next newly-created Entry - in this case 277, as I wanted to keep all my existing entries up to ID 276. When I created a new Entry in EE, it was given the Entry ID of 277. The AUTO_INCREMENT value in the table is showing as 278.

       
Neil Evans's avatar
Neil Evans
1,374 posts
5 years ago
Neil Evans's avatar Neil Evans

Be careful when doing this. Remember that entries and other bits are tied to other tables and data within the database. So when changing it, you need to make sure the rest of the site matches!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.