• Well, I have a complicated (in my opinion) issue here and I need to get it fix as soon as possible. Please help me people, I am a rookie when it comes to database (mySQL).

    Well, weeks ago, my old wordpress crashed, as I install a plugin which crashed with my other plugins. It crashed so badly that I decided to start off with a fresh copy of WordPress.

    What I wanted to do now is merge my old WordPress blog (all I want is the posts and comments only. I would love to set the categories to each posts manually later, my major concern is posts and comments) and my new WordPress blog (which is a fresh copy of WordPress, with a couple posts and some 50 comments).

    According to some threads in this and other forums, to restore the data, all I need is import the tables from old database to the new WordPress’ database, but since the new database also have the same tables as the old one, the import function won’t work. I know I can use “drop table if exist” but I wanted to retain the tables in the new database as well. So, my questions are:

    1) how to merge records in both database together? (or is there a way to import records from old database to new database without overwriting/dropping of tables/records in the new database)

    2) what tables are essential if all I wanted to retain/bring over to new database are the posts and comments? Do I need to import those wp_options and other tables? Or the new tables (of wp_options and etc) on the new database will work as well?

    3) Can I use the import/export functions in WordPress admin? and can I import/export xml files generated from many blogs? ie. I export xml from the old blog, and import it to the new blog, will it overwrite the posts and comments in the new blog?

    P.S: Please lead me step-by-step, I am a total newbie when it comes to mySQL and phpMyAdmin and etc. I have cPanel, phpMyAdmin and is running WordPress 2.2.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter ingsiang

    (@ingsiang)

    I tried just now, and erm, I can’t access my old blog anymore (my fault, I guess), so erm, I can’t use the wordpress ‘export’ function of old blog, so if ‘importing’ doesn’t cause old posts/comments to be overwrited, then can I import and “drop table if exist” to new database (of my wordpress), and use the ‘import’ function of wordpress to import back the posts/comments that was ‘drop’ during the import process of tables from old database to new database?

    Tell me if I didn’t make myself clear enough, thanks people. =)

    if you have access to phpmyadmin (web based ui for managing mysql) then,

    1. Login
    2. Select Database
    3. Go to the Export tab
    4. Select the following tables (more if you want to retain the other tables) wp_comments, wp_postmeta, wp_posts

    (I’d suggest you add wp_categories, wp_options, wp_links, wp_link2cat, wp_post2cat, wp_usermeta, wp_users too)

    5. Press the export button and save the file on your pc
    6. Open the phpmyadmin for your newer blog and import the exported file. You’ll have to drop those tables first if phpmyadmin complains.

    Thread Starter ingsiang

    (@ingsiang)

    Thanks Pravin, so, I can just export wp_comments, wp_postmeta, wp_posts if all I wanted to retain is comments and posts?

    By the way, can anyone answer my question 3)? Thanks. =) Need it. =)

    Oh yea, how about those settings? I mean when we export tables/database in phpMyAdmin, I saw a lot of boxes to be selected or something, do I need to change them? Or just tick the ‘save as file’, and click ‘export’ to download the database?

    Thanks in advance. =)

    Thread Starter ingsiang

    (@ingsiang)

    Somebody help please, urgent help needed. =)

    Hm. I may be missing something, but dropping the tables in your database means you’ll be deleting everything in it, which is not what you want.

    I’m not sure how to merge the DBs though.

    Another possible suggestion (assuming both blogs are at the same WordPress version)
    1. Backup the new blog’s database
    2. Export the new blog using the Export facility in your admin.
    3. DROP the tables in the new blog’s database.
    4. Using phpMyAdmin import the OLD blog’s tables into the new blog’s database
    5. At that point you should be able to see all your old blog’s post etc. Update your permalinks and clean up as necessary.
    6. Use the WordPress Import facility to import the information created in Step 2.

    Thread Starter ingsiang

    (@ingsiang)

    Thanks anyway, DianeV. =)

    Thanks MichaelH, I’ll try it, will update you guys if it works, thanks again! =)

    I hope it works. =)

    Thread Starter ingsiang

    (@ingsiang)

    I have another question, erm, will the post ID of the old and new wordpress crash? I mean, for eg. I use MichaelH’s advice, the database now contains tables of the old database. And when I import the xml file of the new wordpress into it, will the posts clash when posts from a few post from both wordpress contain the same post iD?

    If you are importing xml, new ids will be created for those entries.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Merging two copies of wordpress’ is closed to new replies.