• Hello

    If you use the export link to move your posts to a new server.

    Stop right there

    If you use this function it changes all your post id,s
    So if you already have pages in google such as blahblah/234 it will change to blahblah/36 or whatever

    As you are changing servers you keep your permalinks the same.

    I have just had to redirect 301 70 posts, as if you write a post in your new location and your next id is 91 and you already have Post out there with id 91 your old post will now point to the new one regardless of the title of the post.

    Just my bit to keep anyone from having to go through this bloody hassle.

    My fix for this was to change the old permalink structure from

    /%postname%/%year%/%monthnum%/%day%/%post_id%

    to /%postname%/%year%/%monthnum%/%day%/

    thus taking the ID out of the loop and then redirect all the old posts that were in googles index to to the new permalinsk structure

    If any one has a better idea i would like to know..

    Kev

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Most people don’t put the post ID into the permalink structure, so this is generally a non-issue.

    But yes, ID numbers are not preserved with an export/import operation. If you want to preserve ID numbers, you need a full database dump and restore.

    rob101

    (@rob101)

    Hi Cheaper

    Many thanks for bringing this to my attention. I’m just setting up a WordPress blog and was going to use
    mydomain.com/postId/article,
    so now I guess I’ll have to use
    mydomain.com/year/article

    Is there anything wrong with just using %year% in a permalink, and not %month% or %day%? Apart from making sure a years worth of posts don’t repeat the same article name?

    And I have seen many blogs using just PostID, so I think there should at least be a warning when you try to use them.
    I must have asked about 5 times if anyone could see any problems just using PostID, and this was the first time I saw this problem.

    The export writes the post_id of each post. It’s the problem of the import to actually preserve the original post_id.

    Actually I fixed that: You need to use phpmyadmin or any other way to run a query on your database.

    In the table wp_posts you find these fields: “ID” and “guid”

    “ID” have the post’s id number and “guid” have the whole URL. The field “ID” was changed after the import but the field “guid” remains with the old data.

    EXAMPLE
    In your old database: ID=”58″ and guid=”http://www.yoursite.com/?p=58″

    but in the new database: ID=”66″ and guid=”http://www.yoursite.com/?p=58″ (Yes, it’s still 58)

    So run a query to chop that part of “guid” where the old number is and replace “ID” with that number.

    If there’s somebody who don’t know how to do it, post a reply and I will post the query I used.

    Good Luck

    Hey powerseller 2006, could you please post the query? Thx!

    Hi, Sorry I didn’t check this site lately. You know what? Actually my “solution” brought me more problems.

    What I did was good for the posts, but the categories, tags, and messages got all messed up. They all point to the new ID and when I restored the old ID… you get the picture?

    I only have 112 posts so I’m fixing every one by hand.

    If you want to have more mess than you already have, let me know and I’ll give you some help.

    powerseller2006 – can you still please post your query? perhaps it can be modified to make it work properly.

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Post id number wrong on import’ is closed to new replies.