Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Maria Cuan
Maria Cuan
4,500 Points

Moving Wordpress

Hello treehouse members,

I hope your day is going very well! I have a great issue this morning. :( maybe someone can give me some direction as to what is going on with the website.

Today we were supposed to go live with a wordpress site. I followed the wordpress codex on how to move the site

  1. changed links
  2. moved files in ftp
  3. updated permalinks
  4. used Blue Velvet to fix any links still pointing to the old domain

And....

the media files and slider are all messed up :( When I checked the media library all files have updated links with the new domain.

I have tried everything I can imagine.

www.choosepositivitynow.com

is the website. Please let me know if you have any suggestions or need more information from me.

Help D:

Thank you very much!

E.

5 Answers

Lauren Clark
Lauren Clark
33,155 Points

You have your pages as default permalinks still, I know it doesn't seem related but set them to "Post Name" in settings, and then save changes, regardless this is something you should still do for SEO.

Another thing you can try is an SQL query to find any GUI's velvet blues might have missed and change them to the new URL. I admit rather than mess around in the back end I sometimes take the long way around; which is to go to the sliders and images and then just reselect the image from the media library and then save. If you have a lot of instances of the images referencing the old URL, I'd go run the SQL line. I'm pretty sure velvet blues SHOULD do this, but I always end up with the same issue you're having.

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

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

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

*Edit - Oh! If your table prefix isn't wp_ (which it shouldn't be for security) obs change it. :)

Well. Call me a simpleton, but I do this and never have an issue;

I try not to use absolute URLs for images and posts (use "../wp-content/uploads/2013/12/image.png" instead of "http://www.oldurl.com/wp-content (etc.)" for this very reason, but sometimes have to when it comes to the WP menu.

  1. Write down the menu structure with pencil and paper (yup, "a pencil" - 100% uptime!)
  2. export the Wordpress XML file on your dev and save
  3. copy your dev wp-content folder to the new site running (now running WP)
  4. import the XML file (with all posts and pages (no images)) to your new site
  5. Adjust the menu and permalink structure to match your old site.

Should take about 10 minutes.

I'm no best practice developer - most of where I am is due to 10+yrs of trial and error with WP. Is there a best-practice way that is quicker?

Migrating a WordPress site is always a pain, but there is an easy way.

migrate db pro is worth every penny and now it will migrate all your media content. so with this plugin your steps would be:

  1. Setup a clean WordPress on a live server
  2. Install the plugin on both the dev and the live WP
  3. Push or Pull to the live server

I hope this helps

Maria Cuan
Maria Cuan
4,500 Points

Wow this is great ! Thank you very much everyone !