I am working on a new version our site. Today I was going to put the blog on the new version.
Our current website and the successor I am building are on different servers and accessed by different domain names.
So what I did was import the database the blog uses into the dev site. Then I copied all the files and put them on the dev site. On the dev site I went to /blog/wp-admin and I changed the general settings so the blog URL would use the dev domain.
I made NO CHANGES on the current production website server. However the current production website’s blog is now broken. When I go to blog/wp-admin on the real site, the form posts to the dev server.
I am not able to log into wordpress on either the dev or production site now.
I do not understand how I could break anything on the production server by making changes on a completely separate server that is unrelated to the production server.
So my main goals now are to:
-
Restore the blog on production
server (undo the changes I made
today) and get it working again
right away. -
Figure out what I did wrong so I can
put the blog on the production
server.
If you didn’t hand-change the wpurl in the dev database, what probably happened is that you entered your url, and WP made a 301 redirect to the live site. Then, without realizing it, you changed the url config in your live site.
To make it work:
Put this in your wp-config.php
That should do it.
After you moved the database to new hosting server, go to the wp_options table.
see the row of that table. you can see this siteurl -> http://domain.com (old domain). change to new domain url.
Go to the row number 37 with option_id = 37. Here you can see the home -> http://domain.com (old domain). change to new domain url.
Now go to the site and see. Your site working!!!!!!
When migrating you need to change all references of the previous domain in the database. I recommend using the migrate db plugin: http://wordpress.org/extend/plugins/wp-migrate-db/
As well as Daniels Advice to modify the WP_SITEURL, WP_HOME constants.
Then when you finally can login again. I recommend if you had permalinks turned on to turn them off and then on again. This will clear the .htaccess file and rewrite it to the correct settings.
Finally. Please remember to backup your database before you migrate. You probably have already done that!