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
Issues migrating WP from local to live server
So. I am having some sort of heinous issue migrating my wordpress site from a local to a live server. I have gone through the video a couple of times. I have even deleted everything and started over again. But for some reason after I have migrated everything, it gives me this gloriousness:
Not Found The requested URL /wp-login.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Every time. Is there an error that could be responsible for this?
Hey Maggie, the local-to-live WP migration is definitely not the easiest thing. As I do this pretty often, there are a couple things I know that are always important to do:
After you migrate your database (aka, after you export/make a copy of your local database and import it onto your live server), you have to go into the live server db and change a couple of values. Open the
wp-optionstable and check the first 2 fields,
home. What are the values of those 2 fields? If they have your local site's URL, then you need to change them to your live site URL. And remember to not include a trailing slash on the URL (in other words, write
That change should allow you to at least access your live site's
/wp-login.phppage and log in. Once you're in, click the
Settingslink in the left sidebar, then go to
Permalinks. Whatever option you want for your permalinks, choose that (or leave it where it is if that's preferred), and click "Save Changes" again. That may sound pointless, but WordPress actually rewrites your
.htaccessfile as a result of this Save, and will automatically reconfigure its rules based on the server environment it's now in (aka, it'll configure to your live server environment instead of your local).
Presuming those 2 steps have gotten your live site working for the most part, there's one final step you need to do, which is to universally change any hard-coded absolute URL paths that WordPress set for any images or hyperlinks in any of your content. This is best solved with a plugin, and you can choose one yourself, but I regularly use and like one named Velvet Blues Update URLs that's simple, free, and does the job.
If doing these things doesn't get your live site up and running, let me know and I'll try to help you out further. Good luck!
Try plugin Duplicator, Easiest way to move wordpress.