Problems after upgrade from 0.83 to 0.9

Having trouble installing serendipity?
Post Reply
Guest

Problems after upgrade from 0.83 to 0.9

Post by Guest »

Well after all the upgrade works well. But i have a problem. I make a new entrie in my blog and that worked fine but only with the first post. After i want to do another the error occured and i got this as failure:
Fehler:

INSERT INTO syentries (title,timestamp,body,extended,isdraft,allow_comments,moderate_comments,exflag,last_modified,comments,author,authorid) values ('test 3', '1131892477', 'test 3', '', 'false', 'true', 'false', '0', '1131892502', '0', 'alex', '1')

/ Duplicate entry '0' for key 1

After i searched a bit about what could happen i found out that all new entries after the
the last entrie want an id in the database. But the problem is the id with the new first entrie has not as example id 78 it as id 0. Every new entrie i want to make always want the id 0
in the table. Can anyone help out ?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Problems after upgrade from 0.83 to 0.9

Post by garvinhicking »

This means that your syentries table does have no primary autoincrement key! The s9y installer should have indicate such autoincrement. Did you maybe migrate your DB from one host, or restored a backup that inproperly declared the table structure? Which database type and versoin are you using?

You can run this SQL query to indicate the missing autoincrement key:

Code: Select all

ALTER TABLE syentries ADD PRIMARY KEY (id);
ALTER TABLE syentries CHANGE id id INT(11) DEFAULT NULL AUTO_INCREMENT  
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

Thats correct i transfered my db to another host. What do i have to do after i run this sql query. The last sql db i used was 4.0 now i have 3.23.
Guest

Post by Guest »

After i submited the sql command i got this as answer:
SQL-Befehl:

ALTER TABLE syentries ADD PRIMARY KEY ( id )

MySQL meldet: Dokumentation
#1068 - Multiple primary key defined
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

The best thing is that you export your old Dump again, this time with complete indices, structure and table data. The reason is, that you will have lost other necessary keys for tables as well!

So even if you would execute the query I gave you, it will be missing for other tables. So a new, correct dump is required at this point.

Downgrading from 4.0 to 3.23 is a bad idea, though! You'll loose fulltext search capabilites and speed.

If that primary key query failed, you already have a primary key, but were just missing the "auto increment" option of the column.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

well i lost all. i made a new dump and tried it again. now i have the same error again. Nothing happens correct. i have the same error.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

How exactly to you create your Database dumpfile? It seems you are not using the proper options for creating the dumpfile!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

hi i create it with phpmysql, with the export option.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

phpmysql? Do you mean phpMyAdmin maybe? Which version of phpMyAdmin are you using? You should use at least 2.6.3, and then check all export options.
Older PMA versions are sometimes not able to preserve auto_increment column information.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
takamori

something to try

Post by takamori »

with phpMyAdmin 2.4.0, you can probably click on the table sy_entries, click on the "Change" action on the id field and set the "Extra" column to auto_increment.

At least, it looks like something you can do, based upon the install that my webhost provider has.
Guest

Post by Guest »

:D :D :D :D :D :D :D :D :D :D :D
many many thanks to you takamori. this was the solution.
thank you ver much
Post Reply