Forums

Restoring Backup'd WP - from one site to another (5 posts)

  1. mibsolutionsllc
    Member
    Posted 3 years ago #

    Is it possible to take a backup'd sql file from one domain, and place it in another domain's database. I am trying to restore a current WP blog, wipe out the WP and then restore all the content with a fresh install of WP - there are various bugs that I think completely taking down the WP and putting up a new fresh install in its place might fix, but I need the content to be there still. I have the backup sql file, but when I take it from one domain, and place it in a subfolder (on the same server), it tries to take me to the previous domain's url, which completely doesn't work. Is the only way to have this work is work with one single url's database and restore that? I want to test out the restore processes before I do this on the client's blog, while using the client's blog's database backup sql file. Is this possible to do, or do I need to do the entire process on the same WP database?

  2. VelvetBlues.com
    Member
    Posted 3 years ago #

    Yeh... I generally move blogs by using SQL. However, there is an easy utility where you can just download/upload an XML file.

    To restore your blog, just create an alternate database and import that SQL file. Then install the blog software on the new domain, modify the wp-config file, and perform an 'upgrade'.

    And because you are on a new domain, you will have to perform a few SQL commands to replace all instances of the old domain w/ the new domain in the database... I'll try to find that WP documentation for you.

    Hmm. What kind of server are you on? What's the web host?

  3. VelvetBlues.com
    Member
    Posted 3 years ago #

  4. mibsolutionsllc
    Member
    Posted 3 years ago #

    Yeah I am using a perfect plugin that dumps all my info in a sql file. But the issue is when I restore the sql file on a new database it thinks I am using the previous domain's url - which gives me errors as we both mentioned above. I have found the previous documents, and will go over again now, but I didn't see a section about the commands that will make all my issues go away. Any help is appreciated!

  5. VelvetBlues.com
    Member
    Posted 3 years ago #

    You will need to change the url in a few locations.

    1. In the new blog, go into settings and update the url.

    SQL
    (I'm assuming you have access to phpmyadmin or some other similar utility.)

    2. Update wp_posts guid:
    Command
    UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain-name.com','http://www.new-domain-name.com');

    3. If you link to other posts within your posts, then you'll also need to update post content:
    Command
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain-name.com', 'http://www.new-domain-name.com');

    4. I think that this should be updated when you update settings. However, if it isn't, you can run this command on the wp_options table:
    Command
    UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain-name.com', 'http://www.new-domain-name.com') WHERE option_name = 'home' OR option_name = 'siteurl';

    Be sure to use the appropriate old and new domain names. If this fails, it may be because the domain name in the database doesn't have www in front. It might be inputted as http://old-domain-name.com

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.