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

Rachel Makovoz
Rachel Makovoz
5,005 Points

Migrate Wordpress from local to live error!!!

Hello, So I've migrated my wordpress from local to live and I've had a few issues with internal service error - which I mostly was able to solve. However, for some reason all my content is fully visible on the live site but when I go to the backend to edit - all of my pages are completely empty! Also, all of my images won't come up and strange black diamonds with question marks are popping up all over my site. Please let me know how I can fix this!!!

Thanks for your help Rachel

4 Answers

Ralph Morris
Ralph Morris
3,780 Points

I remember seeing some strange black diamonds on my site once when migrating. It was because when editing the wp-config.php I accidentally deleted the below line to do with character encoding.

define('DB_CHARSET', 'utf8');

Also make sure you are defining your new url as per below.

define( 'WP_HOME', 'http://www.example.com'); define( 'WP_SITEURL', WP_HOME);

And then as Jonathan says it is best to do a find and replace of your old dev url replacing it with your new one. I use https://wordpress.org/plugins/velvet-blues-update-urls/ for this myself but there's a few good ones out there.

Hope this helps.

Ralph Morris
Ralph Morris
3,780 Points

Also when you imported your sql file into your new database you needed to make sure it was set to utf8 there as well. Most likely was by default.

Rachel Makovoz
Rachel Makovoz
5,005 Points

It worked!!!! I changed the db_charset to 'utf8', for some reason it also had a few characters after it - so once I deleted it, the black diamonds went away and I was able to view the pages on the back-end.

I used the url-updating softwarre, and then when I was on one of the pages I clicked "change permalinks", saved it as default again, and then all the images showed up!!!

Thank you so much!!!

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

It may involve using a Find and replace plugin to update your permalinks so your images will show up.

Also update your Root URL in your config.php file so WordPress knows it's searching through the live site.

Rachel Makovoz
Rachel Makovoz
5,005 Points

I already did both of those - but I still have these errors.

Ralph Morris
Ralph Morris
3,780 Points

Great!! Glad it helped!