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