• Hello,

    I have an old wp_post sql file and a new one and I need to migrate posts from both into a new wp_post sql to run in my database.
    However I run into the error Column count doesn’t match value count at row 1
    done
    and I found that the OLD wp_post is:

    examples:

    (2, 1, ‘2003-03-20 12:45:23’, ‘Sådär ja! Då har jag fått upp denna sajten!’, ‘Sajten uppe!’, 1, ”, ‘publish’, ‘open’, ‘open’, ”, NULL, NULL, ‘sajten-uppe’, ”, ”, ‘2011-08-16 11:15:50’, ”, ‘2003-03-20 16:45:23’, ‘2011-08-16 09:15:50’, 0, ‘/?p=2’, 0, ‘post’, ”, 1),

    the new is:

    (31874, 2, ‘2013-09-04 16:01:07’, ‘2013-09-04 14:01:07’, ‘Detta är ju sååååå gott! Underbart till plockbordet med lite salami, ostar etc. ‘, ‘Kokt kronärtskocka med dipp’, ”, ‘inherit’, ‘open’, ‘closed’, ”, ‘31856-revision-v1’, ”, ”, ‘2013-09-04 16:01:07’, ‘2013-09-04 14:01:07’, ”, 31856, ‘http://56kilo.se/31856-revision-v1/’, 0, ‘revision’, ”, 0);

    What I noticed is that there are TWO timestamps in the new field. so that must be the reason why I get this error.

    Any idea on how I can solve this??

    Beside that this is in the beginning:

    CREATE TABLE IF NOT EXISTS wp_posts (
    ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    post_author bigint(20) unsigned NOT NULL DEFAULT ‘0’,
    post_date datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    post_date_gmt datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    post_content longtext NOT NULL,
    post_title text NOT NULL,
    post_excerpt text NOT NULL,
    post_status varchar(20) NOT NULL DEFAULT ‘publish’,
    comment_status varchar(20) NOT NULL DEFAULT ‘open’,
    ping_status varchar(20) NOT NULL DEFAULT ‘open’,
    post_password varchar(20) NOT NULL DEFAULT ”,
    post_name varchar(200) NOT NULL DEFAULT ”,
    to_ping text NOT NULL,
    pinged text NOT NULL,
    post_modified datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    post_modified_gmt datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    post_content_filtered longtext NOT NULL,
    post_parent bigint(20) unsigned NOT NULL DEFAULT ‘0’,
    guid varchar(255) NOT NULL DEFAULT ”,
    menu_order int(11) NOT NULL DEFAULT ‘0’,
    post_type varchar(20) NOT NULL DEFAULT ‘post’,
    post_mime_type varchar(100) NOT NULL DEFAULT ”,
    comment_count bigint(20) NOT NULL DEFAULT ‘0’,
    PRIMARY KEY (ID),
    KEY post_name (post_name),
    KEY type_status_date (post_type,post_status,post_date,ID),
    KEY post_parent (post_parent),
    KEY post_author (post_author)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=31875 ;


    — Dumpning av Data i tabell wp_posts

    INSERT INTO wp_posts (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_content_filtered, post_parent, guid, menu_order, post_type, post_mime_type, comment_count) VALUES

    TIA!

Viewing 1 replies (of 1 total)
  • Thread Starter asefredrikson

    (@asefredrikson)

    Or… What if I run an old wp_post script in my WP database.
    Would WP upgrade the table automatically???

    I’m now using 3.6 but have an old wp_post table.

    My idea is that I run the old wp_posts script to have old posts added. If that table is upgraded/updated I then can run the new wp_posts script to have my newest posts added.

    The problem is this:
    I moved my blog. The blog was moved by exporting through wp.
    Unfortnately attachements were lost and those is located in the wp_posts table.
    So since it’s two months since the move I have posts that I need. (I have my old sql file saved)

    Is this making any sense to anyone? =)

Viewing 1 replies (of 1 total)
  • The topic ‘Migrating old and new wp_posts tables’ is closed to new replies.