Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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:

  1. Restore the blog on production server (undo the changes I made today) and get it working again right away.

  2. Figure out what I did wrong so I can put the blog on the production server.

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

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

define('WP_SITEURL', 'http://your-wp-url.com');
define('WP_HOME', 'http://your-wp-url.com'); 

That should do it.

share|improve this answer
add comment

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!!!!!!

share|improve this answer
add comment

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!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["        <li><a href=\"http://area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"http://careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.3.12.1451\r\n            </div>\r\n                <div id=\"additional-notices\">\r\n                    WordPress is a trademark of the WordPress Foundation, registered in the US and other countries. This site is not affiliated with the WordPress Foundation in any way.\r\n         "], "copyright__copyright__copyright": ["ain. 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.\n\nFinally. Please remember to backup your database before you migrate. You probably have already done that!\n\nshare|improve this answer\nadd comment\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}