Support » Fixing WordPress » Migrating WP to WP

  • Ok I have two blogs on two different servers. The WP blog was migrated to the server back in April but I continued to update the old blog with new entries thru June. Now I want thos added entries to show up on my new server.

    I have looked at other migrating threads but they had to do with different types.

    What would be my easiest way?

Viewing 15 replies - 1 through 15 (of 17 total)
  • Moderator James Huff


    Export your WordPress database from the old blog by following these instructions. Now, on the new server, use phpmyadmin to access the new blog’s database and proceed to the “SQL” tab.

    Now, search your database export for the titles of the single posts that you want to import, or look for the section called “wp_posts”. You will find the desired post(s) in this format:

    INSERT INTO wp_posts (ID, post_author, post_date, post_date_gmt, post_content, post_title, post_category, post_excerpt, post_lat, post_lon, 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) VALUES (4,1,'2004-10-04 22:29:43','2004-10-05 05:29:43','Blah Blah Blah. This is the post content. Boring, yes?','Post Title',0,'',NULL,NULL,'publish','open','open','','post-title','','','2004-10-04 22:29:43','2004-10-05 05:29:43','',0,'',0);

    Now, return to phpmyadmin and the SQL tab for your new blog’s database. To insert the above post, copy all of it, starting at (and including) the post’s INSERT INTO query, and stopping before the next post’s INSERT INTO query. This will insert the post from the old blog into your new blog’s wp_posts table. Once it is inserted, you will probably have to change the post’s URL and ID number in order to avoid conflicts with other posts.

    The above instructions are only for inserting select posts from an old blog to a new blog. To completely replace the new blog with the old blog, just replace the new blog’s database with the old blog’s database. To do that, follow the backup instructions posted above, and follow these instructions to restore the database.

    Thanks for the quick response. @ macmanx

    Recently I have also posted about moving posts from a blog to another.

    Moderator James Huff


    I highly recommend Moshu’s post. It goes far more in depth than my puny post. ^_^

    One last quick question. The domain name that the blog was on is now pointed to the new server. So I can not access the old blog other than through ftp.

    I have downloaded the entire blog, new entries included.

    Would it just be easier to upload the entire blog to the new server?

    I am afraid you couldn’t download your database through ftp.
    All your content (posts, pages, comments, etc.) are stored in the database, not in the WP files that you download via FTP.

    @moshu Then I kinda have a dilemna. I can not access cpanel on my old server as I have since pointed the domain away and to the new server. I can access cpanel on my new server but do not know if that will allow me to do it from there. I thought that I needed to access cpanel from the old server that has the entries I want to migrate. ???

    Thank you also.

    Do you have a backup of the database of your old entries? IN the very first reply to your question macmanx says:

    Export your WordPress database from the old blog…

    Did you follow that before doing anything else?

    No I guess they are just lost, I will try to access the server through the ip# and see if I can get at cpanel that way or at least the entries.

    You need to access the phpMyAdmin of the old server in order to be able to export (=backup) your old entries. You could try to contact the host, too.

    Moderator James Huff


    You need to follow these instructions to export your database:

    I just am able to access the old cpanel thru ip address right now so I am going to use your earlier istructions Thank you and I hope this works. fingers crossed!

    @moshu I am having troubles with #15. I do get an error and I have tried to delete the null as I had four ocasions of this but still the sql errors out. ????

    Thanks in advance.

    This is a lot of work for five entries.

    Well, the way I figured out what caused the error message was to compare the tables in the old and the new database: just the old-fashioned counting how many columns are there. I did it while was browsing (phpMyAdmin) the wp_posts table. Since the only difference in my case was the two columns named “post_lat” and “post_lon” I’ce checked their position (= they were the 10th and 11th column) so in the .sql file I was looking for the 10th and 11th parameter: the content of every column in the .sql file is in between ‘…’ and I deleted what was in the position 10 and 11 – ‘NULL’ ‘NULL’. Does it make sense?

    I appreciate your help and did manage to migrate them but I did not alter the sql file from wp_ to target_. I left it how it was and did not alter the post number either and bingo it was done

    Not sure why you have those added steps as it worked flawlessly without them.

    Thank you again.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Migrating WP to WP’ is closed to new replies.