How to clone wordpress site for the develope purpose?

耗尽温柔 提交于 2019-12-06 10:59:53

Copy/paste your entire files from your domain to everywhere you want as first step.

Go to the phpMyAdmin or use a tool that permit to you to export your database as .sql.

Open the .sql file and run a find and replace and replace all your absolute path (just the one before wordpress: ie.: of this http://www.yoursite.com/wp-content/etc. Replace only http://www.yoursite.com)

Check for the permission of the DB, maybe you should change also the Server name, DB Name, Username and Password.

Create a new database and import the file you exported and modified the minute before.

Now you got a clone of the previous website ready for your experiments on both side, files and DB.

If you're going to use a different hostname or path for the copy of the web site, it's not as simple as copying your files and exporting / importing your MySQL database. There are, in fact, embedded absolute URLs in various columns of the database.

There's a step by step procedure here.

http://codex.wordpress.org/Moving_WordPress

If you were working on WP MultiSite you could avoid having to duplicate your database and then doing a sql find and replace as mentioned by using one of the WP cloning plugins.

The NS Cloner - http://wpmu.org/clone-sites-within-a-wordpress-multisite-network/handles everything for you automatically including the DNS, DB, and Hosting. Based on your mutlisite setup you can then deploy it to a new subfolder or subdomain. For advanced features after your new site is live you can use the Pro Version and do advanced things like search and replace on the live site.

Again this is for MultiSite only, however I would highly recommend moving to that architecture anyway to allow you to take advantage of all of WP multisite has to offer.

WP Staging allows you to clone an entire site including database and files into a subdirectory of your main site for testing purposes with just two clicks: https://wordpress.org/plugins/wp-staging/

What's your problem exactly? You just need to download all worpress files from your server. Then create a local copy of the database so that you have all the data.

All the links are relative in wordpress, so you won't have any troubles with links to the "real site" ;)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!