Grow your CSS skills. Land your dream job.

Transferring WordPress between machines

  • # March 9, 2009 at 10:23 am

    Hello,

    Forgive me, I am new to WordPress.

    I’m transferring my first WordPress site between 2 machines. I transferred the htdocs folder from Machine A to Machine B, so both versions look the same, but the content from Machine A did not load to Machine B.

    How do I transfer the content (posts/pages/comments etc) from Machine A to Machine B?

    thanks for your time,
    Allison

    box
    # March 9, 2009 at 11:16 am

    You will need to transfer your database too. Export it from machine A to a text file, then import that text file on machine B. Typically you would use phpmyadmin to aid this. Then you’ll chagne the base URL in the machine B database to reflect the new location. That’ll allow you to login to your admin area in wordpress and alter any other instances of the old URL.

    # March 9, 2009 at 11:29 am

    The biggest problem transferring the database acrosss machines is when they have different domain names. For instance, if you develop on a http://www.example.com/client and want to transfer to http://www.clientdomain.com/ .

    The problem has to do with attachments. WordPress embeds the attachment url in the post, so if you insert an image in a page it will insert <img src="www.example.com/client/images/image.jpg" />. When you transfer the database over to another machine the contents of the post isn’t updated, so all your attachments point to the old domain.

    I am still looking for a tidy solution to this problem.

    # March 9, 2009 at 11:39 am

    I am no WP genius, and only just really getting into it, but if your site was small enough, would editing/republishing the pages correct those links?

    Rob
    # March 9, 2009 at 11:48 am
    "TheDoc" wrote:
    I am no WP genius, and only just really getting into it, but if your site was small enough, would editing/republishing the pages correct those links?

    Oh yea it would, its just not the best way to spend your time :D lol

    # March 9, 2009 at 12:24 pm
    "Robskiwarrior" wrote:
    "TheDoc" wrote:
    I am no WP genius, and only just really getting into it, but if your site was small enough, would editing/republishing the pages correct those links?

    Oh yea it would, its just not the best way to spend your time :D lol

    What that man said!

    # March 9, 2009 at 12:47 pm

    haha now now boys!

    The reason I ask is because I’ve worked on some custom CMS’s where we’ve made sure to include the ability to publish the entire site (so it’ll go through every page, etc) with a single click.

    There must be some sort of script/addon for WP that allows that?

    # March 9, 2009 at 1:22 pm

    TBH I really love WordPress, but it’s handling of attachments let’s it down badly.

    For instance, the location of the attachment on disk is not stored in the database only the URL is. So if you want to do something with an attachment in a template / plugin you have to reverse engineer the location from that.

    I’m going to be coming across this problem pretty soon when this site goes live so I’ll be scouring WordPress.org for plugins and stuff then.

    box
    # March 9, 2009 at 3:40 pm

    Wordpress should use its base URL for attachments, but it doesn’t for some reason – I’m sure they have their reasons, but I agree that it’s a right pain when transferring sites with image attachments. I’ve not transferred a wordpress site recently however, I’ll have to have a look that that is still the method they use…?

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".