WordPress.org

Ready to get started?Download WordPress

Forums

Exporting and Importing - New Domain and Host (17 posts)

  1. jayc28
    Member
    Posted 10 years ago #

    I have a WP blog under domain http://www.abc.com and I am changing to domain http://www.def.com 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?
    Thanks

  2. Mark (podz)
    Support Maven
    Posted 10 years ago #

    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.

  3. lnguyen
    Member
    Posted 9 years ago #

    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?

  4. carthik
    Member
    Posted 9 years ago #

    The wiki has instructions for backing up and restoring using phpmyadmin, so does http://faq.wordpress.net
    A more convenient way to backup and restore "entries" or posts is in the works :)

  5. lnguyen
    Member
    Posted 9 years ago #

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

  6. southerngal
    Member
    Posted 9 years ago #

    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! :)

  7. OperaManiac
    Member
    Posted 9 years ago #

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

  8. Mark (podz)
    Support Maven
    Posted 9 years ago #

    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.
    OR
    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 :)

  9. southerngal
    Member
    Posted 9 years ago #

    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?

  10. carthik
    Member
    Posted 9 years ago #

    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.

  11. Mark (podz)
    Support Maven
    Posted 9 years ago #

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

  12. southerngal
    Member
    Posted 9 years ago #

    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.

  13. Mark (podz)
    Support Maven
    Posted 9 years ago #

    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 ?

  14. Mark (podz)
    Support Maven
    Posted 9 years ago #

    That was a very curious issue ......I wonder what happened..
    Glad it's sorted though without loss of data :)

  15. southerngal
    Member
    Posted 9 years ago #

    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!

  16. Root
    Member
    Posted 9 years ago #

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

  17. southerngal
    Member
    Posted 9 years ago #

    Yeah, I cannot figure out this one. I have exported the old database, changed the settings for the URL in options. I'm just about at the end of my options! I know that more than one blog can play nice on a domain...just not sure why it's doing that with my comments, categories and archives to my old blog on another domain.They are all on separate MySQL databases on all domains too. I do have them all under a multi-domain plan though...maybe that has something to do with it?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.