WordPress.org

Ready to get started?Download WordPress

Forums

Migrating WP to WP (18 posts)

  1. dawg
    Member
    Posted 9 years ago #

    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?

  2. 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,'http://www.example.com/wordpress/archives/2004/10/04/post-title/',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.

  3. dawg
    Member
    Posted 9 years ago #

    Thanks for the quick response. @ macmanx

  4. moshu
    Member
    Posted 9 years ago #

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

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

  6. dawg
    Member
    Posted 9 years ago #

    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?

  7. moshu
    Member
    Posted 9 years ago #

    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.

  8. dawg
    Member
    Posted 9 years ago #

    @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.

  9. moshu
    Member
    Posted 9 years ago #

    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?

  10. dawg
    Member
    Posted 9 years ago #

    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.

  11. moshu
    Member
    Posted 9 years ago #

    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.

  12. You need to follow these instructions to export your database:

    http://www.tamba2.org.uk/wordpress/backup/

  13. dawg
    Member
    Posted 9 years ago #

    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!

  14. dawg
    Member
    Posted 9 years ago #

    @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.

  15. moshu
    Member
    Posted 9 years ago #

    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?

  16. dawg
    Member
    Posted 9 years ago #

    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.

  17. moshu
    Member
    Posted 9 years ago #

    What you call the "added steps" are in order if the number of columns in the old wp_posts table in the new whatever_posts table is not the same! Which might be caused by a different version of WP (it was my case) or by using a script/plugin? that adds additional columns etc.
    If the two tables are identical - those steps are not needed. (Maybe I should clarify that in my write up :)

  18. dawg
    Member
    Posted 9 years ago #

    I think so (Maybe I should clarify that in my write up :), as I did not realize this and it did cause me some additional problems.

    The blogs of mine were identical except for the few missing posts.

    Thanks again and I did not mean the added steps as a negative comment. The steps did work just fine and good explanation.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.