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

Joseph Franco
Joseph Franco
11,586 Points

Problem with Wordpress and downloading a live site to work on locally.

Notes before: Followed the Wordpress vids up to the launching live site. Was working out of the htdocs folder. Decided to format laptop. Reinstalled all software and mamp. Decided to set up a Sites folder per a new treehouse video. Installed a local-test wp site. Works fine.

Users/JosephFranco/Sites/local-wp-test/

So I worked on a website and uploaded it so that the client could see the work so far. After notes were exchanged I backed up the site and the database and extracted it into it's own folder

Users/JosephFranco/Sites/local-artist-site/

I changed my database settings in the config.php file i downloaded and imported the database into phpMyAdmin under it's own database.

When i run the site I get a couple of links but no css formatting nor images etc etc. when i try to change to access the wp-admin page it cannot find said page not can i access the login page.I am really at confused here. Can anyone help me out?

7 Answers

Julian Gutierrez
Julian Gutierrez
19,201 Points

Did you do a search and replace to update your url's to point to your new site?

Joseph Franco
Joseph Franco
11,586 Points

the thing is that i can't even access the admin area to update that using the Search and replace plugin. (i'm guessing that is what you are referring to?)

Timothy Comeau
Timothy Comeau
3,710 Points

+1 for the urls ... the previous database is probably full of the old url structure so that's why things aren't working; it's looking for resources in the previous location

Joseph Franco
Joseph Franco
11,586 Points

then without having access to the admin area how would i go about changing this?

Timothy Comeau
Timothy Comeau
3,710 Points

It sounds like because you set up a copy of the live site on your local machine, it's probably thinking it's still at example.com/etc rather than at localhost (or localhost:8888/etc)

Use can use Php MyAdmin to see if its recording the old url structure and if so you can change it ... if the database used the wp_ prefix check the wp_options table and the option_value for site_name. Fixing it there might allow you to access the Admin panel again and go from there.

Andrew Cato
Andrew Cato
4,263 Points

This may not be the most technically supportive answer, but I always just use the Duplicator plugin when transferring WordPress sites to avoid having to deal with updating database settings, etc.

Julian Gutierrez
Julian Gutierrez
19,201 Points

Did you lose access after changing the url under settings<general in the dashboard? If so you can change those settings back to what they're suppose to be through your phpmyadmin.

Joseph Franco
Joseph Franco
11,586 Points

No. I havent had access to the dashboard once I unzipped the wordpress site. When I add the wp-admin to the end it gives me Localhost/nameoflivesite/wp-admin cannot be found. Its probably looking for the old url structure as Timothy stated. So how can I change it without having access to the dashboard?

Julian Gutierrez
Julian Gutierrez
19,201 Points

Yes Timothy's answer is the correct way to go about fixing this. If you need more clarification wordpress' documentation should help. http://codex.wordpress.org/Changing_The_Site_URL Scroll down and you should be able to find a section labeled Changing the URL directly in the database.

Joseph Franco
Joseph Franco
11,586 Points

Ok. Ill try that out timothy. Commuting home now but ill give this a go when I get there. Thank you all for your help. I do greatly appreciate it.

Joseph Franco
Joseph Franco
11,586 Points

Hey everyone, so I tried that. I went to the database and found the section about changing the URL directly in the database in the codex. I went to the wp_options table and found the siteurl and home field, changed both to http://localhost/local-bvalentina

and now when i go to the localhost on my machine then navigate to the site folder nothing comes up =/

Any other suggestions ?

Joseph Franco
Joseph Franco
11,586 Points

So i still haven't figured out how to fix the problem but i was successful in migrating the site over using a hybrid of both approaches (Julian's and Andrew's.) I imported the database over locally and changed the names of the site url and home in the database manually. I then used replicator to copy the site over. For now this will have to be my solution until I can figure out exactly what went wrong. Thanks everyone for the help.

Julian Gutierrez
Julian Gutierrez
19,201 Points

That's good to hear. At the the link below I provided a list of steps that I take when moving a Wordpress Site. It might help.

https://teamtreehouse.com/forum/downloading-already-developed-wordpress-site-to-work-offline-with