Page 1 of 1

Problems after upgrade from 0.83 to 0.9

Posted: Sun Nov 13, 2005 3:42 pm
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 ?

Re: Problems after upgrade from 0.83 to 0.9

Posted: Mon Nov 14, 2005 12:03 am
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

Posted: Mon Nov 14, 2005 9:24 am
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.

Posted: Mon Nov 14, 2005 9:31 am
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

Posted: Mon Nov 14, 2005 10:36 am
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

Posted: Mon Nov 14, 2005 11:28 am
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.

Posted: Mon Nov 14, 2005 12:15 pm
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

Posted: Mon Nov 14, 2005 3:31 pm
by Guest
hi i create it with phpmysql, with the export option.

Posted: Mon Nov 14, 2005 4:37 pm
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

something to try

Posted: Mon Nov 14, 2005 5:50 pm
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.

Posted: Mon Nov 14, 2005 7:19 pm
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