Recently, I had to move one of my WordPress projects, from my development server to the client’s server. So what I did was, I copied the database and all the files, created a new database and imported the old one. I then changed the wp-config file accordingly.
Now home page works pretty fine, however I noticed all the routes are still being set to old URLs when I tried to login to the backend. When I typed mynewsite.com/wp-admin it took me to the login page of my development server (myoldsite.com/wp-admin)
I tried several methods to overcome this issue. First I manually replaced all the routes in my database with the new URLs but it broke most of the functionalities. Next, I tried using Search Replace DB script, however since my client’s server was a shared one it threw an AJAX error. I also tried typing mynewsite/wp_login.php which took me to the login page of my new site, still when I enter the credentials and login it routed back to my old site.
Luckily, I found the same question answered on Stack Overflow. And the solution was pretty straight forward and easy.
All you got to do is login to PHPMyAdmin and go to
wp_options table set
siteurl as your new URL. This will fix your routes to work properly. Once you are logged in to the back-end dashboard go to
Setting-> General and check whether the WordPress Address (URL) and Site Address (URL) is set properly.