Reputation: 1261
I have a database backup and entire site folder backup of a wordpress site. I want to setup it in my localhost. These are the steps I followed.
define( 'DB_NAME', 'contents_wp' );
define( 'DB_USER', 'root' );
define( 'DB_PASSWORD', '' );
define( 'DB_HOST', '127.0.0.1' );
But I cannot log in to the admin panel. It redirects to the live site. How to solve this? What I am doing wrong here?
Any suggestions will be appreciated.
Upvotes: 1
Views: 908
Reputation: 271
For migrate Wordpress website You require to Edit information in config.php
file, After that In your Database table name "wp_options
" Require to edit value in "siteurl
" and "home
" fields.
1)) siteurl is url where to redirect our site, when we write url in browser. 2)) home is url , when we add url/wp-admin, then where to redirect.
Upvotes: 0
Reputation: 825
Simple trick here
1>> Delete your wp-config.php file, so that it will ask you re create the file
2>> Give the details as the system asks, like your db name, user name, password and table prefix.
3>> Next set the site title and log in to the admin panel.
4>> After logging in to the admin panel go to the "settings" menu set the "site url" and "home url" over there.
5>> Then you are all set with the settings, you can see your site in the system now
6>> You might need to change the image paths if required, for that build a query and run that for ex:
update clc_postmeta set meta_value= REPLACE(meta_value,
'http://wp.raddyx.in/CLC-Wordpress', 'http://clc.com/~clc/') WHERE
meta_value LIKE '%http://wp.raddyx.in/CLC-Wordpress%';
7>> Atleast run this query for wp_posts and postmeta table
Upvotes: 1
Reputation: 445
You need to edit the site URL : http://codex.wordpress.org/Changing_The_Site_URL
Upvotes: 1