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

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Finishing WordPress Migration from localhost to server

Hi all.

I've been looking again at trying to migrate my wordpress website, made with the Wordpress Theme Development course up to my server. But it's proving difficult.

After working with my web host to solve problems importing the database from local host and setting up the config file, I found this....

Screenshot included: http://www.jonniegrieve.co.uk/assets/img-host/migrate.png

Any idea what I'm missing?

  • I've imported the sql file across from localhost to phpmyadmin on cpanel
  • I did change the username and password in the wplocal.sql file so the import would work
  • I've changed the wp-config settings to match the database on cpanel
  • I've correctly set up the database using the mySQL wizard on cpanel

Is it simply because I'm trying to set up Wordpress on a domain add-on? I know I'll have to update some URL's but I can't get into the admin side to do that at the moment. :)

3 Answers

Cliff Tam
Cliff Tam
2,948 Points

Can you check whether the images are located in http://jonniegrieve.co.uk/wordpress-jonniegrieve.co.uk/assets/img/temp/?

It looks like the anchor link is not pointing to the image probably or the image is not uploaded on the right folders in the server.

I checked this -> http://jonniegrieve.co.uk/wordpress-jonniegrieve.co.uk/assets/img/temp/item-01.png and i get a 404 error.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

They're not located there because I don't have an assets folder either in my local setup or on the server. It's odd that Wordpress is looking there.

Anyway I've added all the files to the server but I'm unable log in to the wp-admin using the login details for the user.

I'm at a loss.

Hi Jonathan,

Not sure if you do or not from what you've said, but have you purchased a standalone domain? I don't have much experience working with sub or addon domain setups, but if you need to change the site URL in WordPress without accessing the admin area you can define the WP_HOME and WP_SITEURL in the wp-config.php file underneath the database information section:

define( 'WP_HOME', 'http://yourwebsite.com');

define( 'WP_SITEURL', 'http://yourwebsite.com');

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi Matt.

Yes, jonniegrieve.co.uk is my domain. And I have 2 addon domains one of which is my Wordpress one.

So there's jonniegrieve.co.uk/jg-lab.co.uk and jonniegrieve.co.uk/wordpress-jonniegrieve.co.uk/

Currently my main domain is not a Wordpress site. I did it this way because it would be cheaper than buying a domain simply for Wordpress installations and I have successfully set up a WordPress installation directly to the wordpress-jonniegrieve.co.uk addon. My understanding was that "addon" domains or even simple sub directories could act as a project root for Wordpress.

Hope you're with me so far :)

I've used the 2 constants you've mentioned but it's not really helped so far getting me into Wordpress on server side. I had such a time last night trying to sort it. So I eventually ended up deleting the files and I'm going to have another go with the process later today :)

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Alright...

I've made some progress.

The reason the front page my website wasn't showing up was because there was a batch of HTML files in the root of my Wordpress installation. That is also why there was a list of broken images on the site. I also deleted the img folder that was there, making sure all the images I needed were in the wp-uploads folder. Once I did that, the front page of my website showed up.

Awesome! :-)