Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2011-06-05 23:22:43
- rraphal
- New Member
- Registered: 2011-06-05
- Posts: 2
Why is new article ID 0?
Hello there txp experts…
I recently migrated my textpattern installation to another server & another mysql database. I dumped the db, imported to a new location, changed txp config. The site works, but there’s a catch…
When I try to post a new article it gets the id=0, not the next available one (should be 570).
Why is that? How to fix it?
Kind regards,
Rafal
Offline
Re: Why is new article ID 0?
Sound like auto-increment value isn’t set correctly. Make sure that the SQL dump includes the auto-increment values in the queries that create the tables. From the SQL file you should find several statements similar to AUTO_INCREMENT=xxxx
.
If didn’t, and you used phpMyAdmin (or some other database management script) to generate the export (dump), make sure you have checked Add AUTO_INCREMENT value option. Otherwise things will break when adding more stuff to the database.
Last edited by Gocom (2011-06-06 00:21:39)
Offline
#3 2011-06-08 09:44:28
- rraphal
- New Member
- Registered: 2011-06-05
- Posts: 2
Re: Why is new article ID 0?
Indeed…
For some reason the ID column in textpattern table lost its’ auto_increment.
alter table textpattern change ID ID int auto_increment;
alter table textpattern auto_increment = 570;
The above did the job :)
Thanks!
Last edited by rraphal (2011-06-19 12:20:45)
Offline
Pages: 1