Support » Fixing WordPress » Exporting and Importing – New Domain and Host

  • I have a WP blog under domain and I am changing to domain as well as changing hosts.
    I have seen several posts here about exporting my WP entries using a SQL dump from phpMyAdmin. That brings me to my first question:
    What options should I take when setting up the export? What format should it be saved in?
    Once I have the SQL dump, I want to take those entries and move them to the new server and domain. I know that once I get the entries imported I will have to make adjustments on the wp_options table so that the redirects work correctly.
    Question is, how do I import that data? Can it be done through phpMyAdmin and if so, how?

Viewing 15 replies - 1 through 15 (of 16 total)
  • I don’t have any real answer, but if I were exporting, I’d do it in a variety of formats just to be safe.

    I’m about to do the same… if anyone has any tips on how to get it going… that’d be great. For instance.. the database names are going to be different… so how is that going to work?
    should we install wp on the new server/domain and then just import data and copy setting files over?

    The wiki has instructions for backing up and restoring using phpmyadmin, so does
    A more convenient way to backup and restore “entries” or posts is in the works 🙂

    yes, that backs up and restores…. but will it still work if you’re moving to a different domain (and a different dB name). Not only that.. but is it better to install fresh and then edit files (and what files..) or just copy it all over and edit the settings acordingly…

    I would like to move posts only from one domain to another. How do I do this without using the same table names?
    I have WP installed and running on the new domain, I just need to import the posts.
    Thanks in advance! 🙂

    i never had problems with changing databases name. tablenames matter coz database names are configured in the wp-config file. 🙂
    and well, since most hosts provide a temp location to access ur new webspace, u can shift the blog before leaving the old domain altogether…

    If you have exported an sql file from the previous database, then first of all copy it and keep the copy safe.
    Then open it up, and in there, just before the posts table, will be something like this:
    CREATE TABLE wp_posts (
    ID int(10) unsigned NOT NULL auto_increment,
    post_author int(4) NOT NULL default '0',
    post_date datetime NOT NULL default '0000-00-00 00:00:00',
    post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
    post_content text NOT NULL,
    post_title text NOT NULL,
    post_category int(4) NOT NULL default '0',
    post_excerpt text NOT NULL,
    post_lat float default NULL,
    post_lon float default NULL,
    post_status enum('publish','draft','private','static') NOT NULL default 'publish',
    comment_status enum('open','closed','registered_only') NOT NULL default 'open',
    ping_status enum('open','closed') NOT NULL default 'open',

    and more …
    Copy all of that, and paste it into the SQL textarea of phpmyadmin. Then press Go.
    That should create the table correctly, and put your existing data into it.
    Copy the same area, and save it as “posts.sql”, then use the Browse button to locate it on your machine and let it run.
    This *should* work .. it has done on my xampp setup, but you may want to wait for someone to confirm that this isn’t a recipe for server meltdown 🙂

    Thanks Podz! I have a new problem, the categories, images, everything is pointing to the old domain, even though I’m using a new domain that’s resolved and the config.php is correct. Any clues?

    southerngal, if you still have access to your old domain name, use a rewrite rule for the images folder as such to redirect to the new image folder.
    If you do not, then, uhm, a little php codeing with preg_replace to find, replace and update strings should be useful.

    or, and again use a copy of your data, try running a find/replace on the sql file before uploading it through phpmyadmin.
    You’ll need to drop the posts table and redo what you did before.
    It should work….

    Podz, thanks for that. I went into the options and found it on the MySQL before I ran it again.
    The background images and the images in posts aren’t showing up though. Should I delete the posts and post them again? I just wonder what I’m missing in the coding. I double and triple checked the .CSS and the background and banner are correct for the new domain. All the images in the posts, such as pictures aren’t showing up either.

    If you View Source, and copy an image path into a new browser window, do you see the image in question ?
    If they were posted using absolute url’s, and you have those images in the same place on the new domain, I can’t see why they would not show up.
    Even a relative path should be okay, again if the directory structure has not changed.
    Are you hotlinking to your last site at all ?

    That was a very curious issue ……I wonder what happened..
    Glad it’s sorted though without loss of data 🙂

    Yeah, didn’t lose anything. I have a weird thing going on now with another blog on the new domain. I have it in a separate directory of course. 😉
    All the categories, comments, recent comments, etc. are pointing to the old domain. Any ideas as to what this could be? All the images and posts are fine. Just weird!

    Yes. We are beginning to call this the Xfiles effect. really wierd. Ive been there.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Exporting and Importing – New Domain and Host’ is closed to new replies.