admin管理员组文章数量:1122846
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.
- Create a database
- Import the database_backup.sql
- Open the wp-config.php and edit the following details
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.
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.
- Create a database
- Import the database_backup.sql
- Open the wp-config.php and edit the following details
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.
Share Improve this question edited Feb 8, 2019 at 23:58 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Nov 27, 2013 at 10:05 SukeshiniSukeshini 1751 gold badge3 silver badges9 bronze badges2 Answers
Reset to default 1Before import database_backup.sql. You have to replace server url with your local url in sql. for example: you took backup from abc.com , and your local url is localhost/abc .then open database_backup.sql and find and replace abc.com with localhost/abc. Save and import now.
I prefer the approach of Charles as that is a lot easier, safer and useful approach. Still you can follow as mentioned by Saifur.
I will suggest one point here i.e. not to replace the data directly in the sql file. This is because wordpress stores data in terms of serialized manner. So even though you replace the data correctly, it may not work 100%.
In this case you first create the database and import the sql file. Then use a script to make a search and replace directly in the database. One such useful script is this one http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ I have used this many times and it has always worked.
本文标签: local installationHow to setup a wordpress backup in localhost
版权声明:本文标题:local installation - How to setup a wordpress backup in localhost? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736311014a1934586.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论