{"id":871,"date":"2018-01-23T12:01:14","date_gmt":"2018-01-23T12:01:14","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=article&#038;p=871"},"modified":"2020-03-25T14:42:30","modified_gmt":"2020-03-25T14:42:30","slug":"duplicate-wordpress-website","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/duplicate-wordpress-website\/","title":{"rendered":"How to Duplicate a WordPress Website"},"content":{"rendered":"<p>In this article, you will learn how to easily duplicate a WordPress\u00a0website for development or testing purpose.<\/p>\n<p>1. Log into your <a href=\"https:\/\/chemicloud.com\/kb\/article\/how-to-login-cpanel-whm\/\" target=\"_blank\" rel=\"noopener noreferrer\">cPanel<\/a><\/p>\n<p>2. Create a subdomain<\/p>\n<p>The <a href=\"https:\/\/chemicloud.com\/kb\/article\/how-to-create-new-subdomain-in-cpanel\/\" target=\"_blank\" rel=\"noopener noreferrer\">subdomain<\/a> will be used for accessing the development site. For example: dev.domain.com.<\/p>\n<p>3. Go to your &#8220;File Manager&#8221;<\/p>\n<p>The <a href=\"https:\/\/chemicloud.com\/kb\/article\/use-file-manager-cpanel\/\" target=\"_blank\" rel=\"noopener noreferrer\">file manager<\/a> can be launched from your cPanel control panel.<\/p>\n<p>4. Copy your WordPress Files<\/p>\n<p>The next step us to copy the files of your WordPress site from your current directory to the document root directory created for your subdomain (dev.domain.com).<\/p>\n<p>The root directory usually is the same name as the subdomain that was<br \/>\ncreated. (Or you can also copy those WordPress files\/folders from current directory to that subdomain directory, using FTP client software, such as <a href=\"https:\/\/chemicloud.com\/kb\/article\/how-to-use-ftp\/\" target=\"_blank\" rel=\"noopener noreferrer\">FileZilla<\/a>).<\/p>\n<p>5. Create a new database<\/p>\n<p>This will be used to separate the test site from your main site. If you use the same database for the development site, the live site will reflect the changes that are made on the test site. Importing the existing database to the test site database will prevent this. You can <a href=\"https:\/\/chemicloud.com\/kb\/article\/create-mysql-database\/\" target=\"_blank\" rel=\"noopener noreferrer\">create a new database<\/a>, by using PhpMyAdmin in cPanel.<\/p>\n<p>6. Export your current database<\/p>\n<p>You can easily <a href=\"https:\/\/chemicloud.com\/kb\/article\/exporting-databases-tables-phpmyadmin\/\" target=\"_blank\" rel=\"noopener noreferrer\">export your database<\/a>, by using PhpMyAdmin in cPanel.<\/p>\n<p>7. Import your Database<\/p>\n<p>Now you will need to <a href=\"https:\/\/chemicloud.com\/kb\/article\/importing-databases-phpmyadmin\/\" target=\"_blank\" rel=\"noopener noreferrer\">import<\/a> the recently exported\u00a0database, to\u00a0the new database that you have created. This can be done from the very same\u00a0phpMyAdmin.<\/p>\n<p>8. Change the site URL<\/p>\n<p>The final step is to change the site URL for your development site. This can be easily done by adding the following code snippet into your wp-config.php file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">define('WP_HOME','http:\/\/dev.domain.com');\r\ndefine('WP_SITEURL','http:\/\/dev.domain.com');<\/pre>\n<p>That&#8217;s it.\u00a0Now you know how to\u00a0duplicate a WordPress\u00a0website for development or testing purpose.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will learn how to easily duplicate a WordPress\u00a0website for development or testing purpose. 1. Log into your cPanel 2. Create a subdomain The subdomain will be used for accessing the development site. For example: dev.domain.com. 3. Go to your &#8220;File Manager&#8221; The file manager can be&#8230;<\/p>\n","protected":false},"author":10,"featured_media":873,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[40],"ht-kb-tag":[],"class_list":["post-871","ht_kb","type-ht_kb","status-publish","format-standard","has-post-thumbnail","hentry","ht_kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=871"}],"version-history":[{"count":2,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/871\/revisions"}],"predecessor-version":[{"id":2018,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/871\/revisions\/2018"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=871"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=871"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}