Title: Error when posting
Last modified: August 18, 2016

---

# Error when posting

 *  [cosmogrrl](https://wordpress.org/support/users/cosmogrrl/)
 * (@cosmogrrl)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/)
 * I’ve been upgrading to 2.0.2 from 1.5.2. Other than Lazy Image Layout, everything
   seems to be working great, with the exception of posting! When I try to post 
   I get this message:
 * `WordPress database error: [Duplicate entry '0' for key 1]
    INSERT INTO wp_postmeta(
   post_id,meta_key,meta_value) VALUES ('0','_pingme','1')
 * WordPress database error: [Duplicate entry '0' for key 1]
    INSERT INTO wp_postmeta(
   post_id,meta_key,meta_value) VALUES ('0','_encloseme','1')
 * Warning: Cannot modify header information - headers already sent by (output started
   at /hsphere/local/home/sheff/konnorwithak.com/blog/wp-includes/wp-db.php:102)
   in /hsphere/local/home/sheff/konnorwithak.com/blog/wp-admin/post.php on line 
   60
 * Does anyone know how to fix this? I’m assuming it’s an error in my database.

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380361)
 * After you finished copying the upgrade files, did you run /blog/wp-admin/upgrade.
   php?
 *  Thread Starter [cosmogrrl](https://wordpress.org/support/users/cosmogrrl/)
 * (@cosmogrrl)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380362)
 * I have, I also just re-ran it and I still get the same error 🙁
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380363)
 *  error.
 * It seems like I’ve seen those DB errors before, but my initial search didn’t 
   turn ’em up. I’ll try some more shortly.
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380364)
 * Oh – and make sure you’ve either turned off all your plugins or updated them.
 *  Thread Starter [cosmogrrl](https://wordpress.org/support/users/cosmogrrl/)
 * (@cosmogrrl)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380675)
 * Alrightie, I’ve narrowed down the problem, only now I can’t fix it. It seems 
   that when I post it sets the post id to ‘0’, not the next sequential number (
   in this case it should be post #69). How do I solve that? The problem seems to
   lie in my wp_postmeta table. When I compare it to one of my other wordpress databases
   I notice that the difference lies in the “cardinality” of the PRIMARY. Could 
   this be because not only did I do an upgrade, I also changed domains? I backed
   up the database and imported it to the new domain, then ran upgrade.php. The 
   MySql versions were not the same. Should I instead be using my original database
   somehow by editing wp-config.php?
 *  Thread Starter [cosmogrrl](https://wordpress.org/support/users/cosmogrrl/)
 * (@cosmogrrl)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380785)
 * Oh yeah – forgot to mention – I’m upgrading from: 1.5.1.3
 *  [mjhammelgraphics-museorg](https://wordpress.org/support/users/mjhammelgraphics-museorg/)
 * (@mjhammelgraphics-museorg)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380914)
 * Cosmogrrl, I have the exact same problem but haven’t found a fix yet. I had WP
   1.2 running on a staging server (for testing) and a colo server (production).
   I upgraded on the staging server to 2.0, then dumped the db and installed wp 
   2.0 from scratch on the colo server. I manually changed all of the server references
   in the dumped 2.0 db from “staging” to “production” (according to the WP notes
   on moving the db to a new server). Then I loaded the modified 2.0 db dump from
   the staging server onto the colo server. This worked for existing data, but somehow
   it’s munged the wp_postmeta table. The post ids are not incrementing and only
   the very first post (post id=0) got submitted (because there was no id=0 initially–
   posts started with id=1). All subsquent posts try to submit to the same id (id
   =0) and fail.
 * I wish I were more of a db expert here. I’m not sure how to tell mysql to autoincrement
   and to reset the next id value to be 84 (which is 1 more than the number o posts
   currently in the database). I installed phpMyAdmin but that isn’t helping me 
   much. More important is *why* did this happen during the migration. Did I mess
   something up? Or did I miss something during the migration?
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380918)
 * Did you go from 1.2 straight to 2.0? My understanding is that you’d want to go
   1.2 -> 1.5.x -> 2.x with each upgrade.php along the way.
 *  [mjhammelgraphics-museorg](https://wordpress.org/support/users/mjhammelgraphics-museorg/)
 * (@mjhammelgraphics-museorg)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380920)
 * Hmmm. I don’t think so. I think I went straight to 2.0. I hope that doesn’t mean
   I’m dead in the water.
 * I have the old 1.2.1 db. I should be able to load that db on the staging server,
   then install 1.5 and do the migration there. Then I can do the 1.5 to 2.0 migration
   on the staging server as well to get a db that I can push to the production server.
   I’d lose one post on the production server, but that’s easily saved off before
   reloading the properly migrated db on the production server. And I can manually
   repost afterwards.
 * I’ll give that a try. I don’t know what else to try at the moment.
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380921)
 * Yep, that’s what I’d try. Save the dbs along the way just in case you need to
   regress (but sounds like you already know that).
 *  [mjhammelgraphics-museorg](https://wordpress.org/support/users/mjhammelgraphics-museorg/)
 * (@mjhammelgraphics-museorg)
 * [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380922)
 * Thanks HandySolo – looks like doing the migration in the proper order fixed things.
   I migrated from 1.2.1 to 1.5, then migrated from 1.5 to 2.0.2. I also did this
   on the staging server and when I was done I was able to change the appropriate
   entries in the db manually to move the db to the production server.
 * Looks like it’s working properly now. I can post new messages and the post ids
   look correct.
 * Thanks again.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Error when posting’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [upgrade](https://wordpress.org/support/topic-tag/upgrade/)
 * [wp_postmeta](https://wordpress.org/support/topic-tag/wp_postmeta/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 11 replies
 * 3 participants
 * Last reply from: [mjhammelgraphics-museorg](https://wordpress.org/support/users/mjhammelgraphics-museorg/)
 * Last activity: [20 years ago](https://wordpress.org/support/topic/error-when-posting/#post-380922)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
