I tried to move my wordpress site from local development to the live server, following the codex, but I screwed something up and couldn't get it to work.

Now, I did create a backup, but I ended up futzing with a few things in there. See, I was using Dreamweaver, and thought I could use the local installation as the testing server and the "live" (really just a testing server that's on my hosting service so I can show the client) server as the remote. I had this brilliant idea, thinking I could use the same files and switch between the two.

Of course, moving requires migrating the database and editing the config.php file to point to it, which I thought I did, but because I misread a few things and did things in the wrong order, it all became very convoluted and I wasn't able to login or see my site. To continue my streak of awesome choices, I started monkeying with the database I'd migrated to the live server. You know, casue I had already screwed it up, how much worse could it get?

After edging closer to being able to login but ultimately failing, I decided I'd best go backward to the beginning. Only problem was now I had changed some things in the config.php file. That's fine, I said, I'll just change them back. So I did. Bingo, I could log in to my localhost admin and see my homepage. Yay!

But then uh-oh! All links from the homepage were returning a 404 page:

"Not Found

The requested URL /index.php was not found on this server."

Yikes! How did I do that? I didn't alter the locally hosted database, as far as I know, I'd be too chicken for that), just a couple of php files which I changed back. Has anyone seen this and knows what's going on? I'd hate to have to start this whole thing over again. I was just starting to like WP, too. :(

I do have a backup of the working database, If that's my problem...

Any help would be greatly appreciated, because as of right now my site is dead in the water.

1 answer

danwellman 5600
0
points

It may not be a database issue so check a couple of other things before messing with that again.

It sounds like the site_URL setting in the wp_config.php may be set to the live URL rather than the test URL, so the link is trying to load http://live.site.com/index.php instead of http://test.site.com/index.php (or whatever your URLs are).

What happens when you hover over a link to the page you are trying to access, it should show the full URL in the browser's status bar at the bottom. That should show you what URL you are actually trying to open.

Also, can you access pages by typing in the full URL in the address bar of the browser instead of trying to access it via links? The liklehood is that all of your pages (and work/effort) are still there, you just need to correct a few settings to be able to access them again...

Check the settings in wp_config.php first and verify they are correct. If they are correct already, then perhaps think about reverting the database to the backup. Refer to this page for info and steps to check these settings: Changing the Site URL

Posting the exact sequence of events, including the steps you took and files/settings you changed may shed further light on the issue.

Although when something that should be straight-forward but isn't can be frustrating, and although you can feel like you've wasted a lot of time and effort, remember that the system was only doing what you told it to, regardless of whether that was actually right or wrong. Wordpress is a stable, mature and extremely versatile platform that is used daily by millions of people ;)

Mistakes like this can only lead to a better understanding in the long run, so realise what you've done and how to fix it and you won't make the same mistake again.

Answered over 8 years ago by danwellman
  • Thanks, Dan. Looks like it was a problem with Permalinks, although I don't know why that would happen. I set them back to default and now the site works again. I suspected initially the same thing you did, but hovering the links showed that they were correct, so that theory got put to bed. Of course this also raised my panic level. In the process did end up restoring the database from a backup (I followed that part of the directions, at least) to the state it was in when it was working perfectly, just so that there was no doubt. matt kristiansen over 8 years ago
  • You're absolutely correct about these mistakes being a good teacher. I was getting pretty fearless and eventually lost track of all I had done, but as I went along I was beginning to gain an understanding of how all these parts work together. And heck, now that I have my site and admin back, I can say it was well worth the time. I still like WP. There is a learning curve, but if millions of people can do it, so can I. Now to try moving this sucker one more time. Thanks again, Dan, for the help, the link and the encouragement! matt kristiansen over 8 years ago
  • no problem, we've all done it at one time or another ;) danwellman over 8 years ago