How to duplicate a WordPress Site for Development and Testing

It’s best to test major changes on a duplicate WordPress website before doing so on a live website. There are multiple ways to accomplish this including the Softaculous Staging option or the TotalUpkeep Backup plugin.

Below we’ll outline how to manually create a copy of a WordPress site for testing.

Warning: This tutorial is made for single-site installations. If you are using the multisite option, this method will create TWO SEPARATE MULTISITE installations. When you duplicate a multisite installation, the duplicated structures and data will fall under the respective multi-site installation database and WordPress files. This can be confusing. If you are not familiar with the differences between multisite and single-site, please only use these directions for duplicating a single-site WordPress installation.

Psst! Check out our Nginx-powered WordPress Hosting for enhanced performance capable of handling multiple WordPress websites with ease.

Copy a WordPress Site to Another Location

  1. Log into cPanel.
  2. Create a subdomain for the testing site – e.g. testsite.example.com.
  3. Open cPanel File Manager and make sure that Show Hidden Files is enabled.
  4. Copy WordPress filesNavigate to your WordPress root directory and copy your WordPress files from your current directory to the subdomain root directory you created, usually the same name as the subdomain itself.
  5. Select all WordPress files.

    Warning! When selecting your WordPress files, make sure the folders for the subdomains/addon domains, or any other non WordPress folders, are not selected. After clicking Select All, hold the Ctrlkeyboard key and click the folders that are not being moved so they are not highlighted before copying the files. If you’re on an Apple computer you would use the Command key to do the same thing.

  6. Select files to copyClick Copy on the top of File Manager.
  7. Change destination file pathType the path to the new subdomain document root folder.
  8. Copy the .htaccess file. This file needs to reside in the same location you have copied your WordPress files or at the root of the new location. The .htaccess file may contain important references to your current WordPress installation. Depending on your installation setup, you may need to look for this file in the root of the account. For example, InMotion Hosting normally uses a document root of “public_html.” Check this location for the .htaccess file if you did not find one in the original installation location for your WordPress site.
  9. Create a database. This will be used to separate the test site from your main site. If you use the same database for the test site, the live site will reflect made on the test site. Using a new test site database prevents this.
  10. Export your current database.
  11. Import your database to the new database you created.

Configure Test Site

  1. Configure the Test WordPress wp-config.php file for the test site. This ensures it uses the new database.
  2. Change the site and home URL for the test site to the test subdomain to update the WordPress database.
  3. Correct image links as these are in the database but not connected to the site URL.

Enhance WordPress with security plugins and fix mixed content errors for SSL (HTTPS) usage with Really Simple SSL.

355 thoughts on “How to duplicate a WordPress Site for Development and Testing

  1. Really helpful article. I was looking for a way to clone my WordPress site and this helped me a lot. Thanks!

  2. Someone has cloned my website… now my website traffic was down very fastly how do I block that cloned website…. please help me… 🙁

    1. I’m sorry to see that this happened. Unfortunately, you can not block their content. I recommend reporting this to them and their host. By using their domain name, you can determine the host most times by looking up their WhoIs information, which is publicly available.

  3. If your cPanel has Softaculous, you’ll just have to CLONE the existing website to the subdomain for development/testing. As easy as that!

  4. Hello, thanks for the tutorial. I followed all the steps above, but I can not access the test site, I get the following message:

    This site can not be reached

    server IP address could not be found.

    The original site works perfectly, but apparently it does not find the subdomain.

    What have I missed?

    Note:  I created and copied the subdomain folder but it does not show up as a folder under public_html but at the same folder level as public_html 

    Thanks in advance!

    1. Make sure that the URL you’re using is something that you have registered to the internet and pointed to our hosting service.In most cases, the problem is simply that you did not make the domain an add-on domain. You can do this in the cPanel. If you’re using a subdomain, then it should work. If you continue to have problems, then you will need to contact our live technical support team.

  5. Thank you for this, very helpful and easy to follow.  The only thing I am stuck on is exactly which files I copy.  When I go to my file manager and click on Public_html there are many folders.  Is it just the three that start with WP that I need to copy?  It also doesn’t just let me click on the wp-admin folder and copy, I have to highlight all the files inside that folder and copy them.  Do I just create a new folder in my subdomain folder called wp-admin and copy those files in there?

    thanks so much.

     

    1. By default, the only folders used by WordPress are the wp-content, wp-admin, and wp-includes. depending on your plugins you may or may not have additional ones to move. You should be able to copy the wp-admin folder, you can also create a new one and copy the files into it however you may want to ensure your permissions are correct on the wp-admin folder as that could prevent you from being able to copy it and cause other issues later on.

    2. www.staging.our3kidsvtheworld.com does not work because there are no DNS records for that subdomain, I do see there is a DNS record for staging.our3kidsvtheworld.com so it looks like the www. may have been left off when creating the record.

  6. I’ve followed all these steps and I get this error message when trying to log in,
    This site can’t be reached
    www.staging.our3kidsvtheworld.com’s server IP address could not be found.
    What have I done wrong?
    Thanks
    Craig

  7. I want to rebuild my site in WordPress but I don’t want to leave the old site live until the new site is ready to launch.  Is this the process I would follow? And if I change the site URL will customers still be able to access the old site?

    1. Hello.

      If you want to rebuild your website in WordPress but do NOT want to leave the old site live you would want to create an Under Construction page. Then you will want to redirect the old website to the Under Construction page, while you create the new website in WordPress. If you change the site URL, then you will need to tell your visitors to visit the new URL. Otherwise, you can create a redirect to the new URL, once you have completed the new website.

      Best Regards,
      Carlos D

  8. I’ve followed all the steps but when I try to load my duplicated site I just get a white page. I’m trying to copy danhuntcamera.com to dev.danhuntcamera.com to update my wordpress template while the exisiting site remains active. I’ve double checked the steps and can’t find an error. Is there something I’m missing? Thanks

    1. In step 9 above you will change the site URL. This new URL is where you will navigate to your test site. You should be able to add /wp-admin to the end of that address to access the dashboard login page.

      Thank you,
      John-Paul

  9. Thank you very much, after trying so many plugin and following so many tutorials I found this is the very best tutorial ever and works like charm. This is the best solution and the only one that works for me til now

  10. Great tutorial!  I followed all of thye steps and our stest site seems to be running on the subdomain.  I have only one issue.  I cant access the test site dashboard.  When I go to log in to the WP test site dashboard, it successfully logs me into the live (user facing) test site with my login acknowledged in the upper right corner.  when I click on the menu item at the top left to go into the dashboard, it just winks at me and reloads the user facing test site.  What I left out or do I still need to change? – Thanks in advance

    1. Sorry for the problem with the duplicate site not loading the WordPress dashboard. If the dashboard is not working, then it’s either a configuration issue, file issue, plugin issue, or possible caching issue. If you’re using caching, make sure to turn it off and test. If you have any security plugins, they should also be reset. Try disabling all of the plugins by renaming the plugins folder to something else temporarily. If it still doesn’t work, then double-check your configuration file and re-load the core files for your WP site. Make sure that you backup the original files. You can obtain WordPress installation files from he WordPress.org site. If you require further assistance, then you may want to contact our live technical support team (if you’re an InMotion Hosting customer), or contact your host’s technical support to look into it further.

  11. Great tutorial. Very clear. I followed the steps ’til step 8 and then got this error
    define(‘WP_SITE_URL’, https://training.xxxxxxx.com’); define(‘WP_HOME’, ‘https://training.xxxxxxx.com’); 
    Warning: Cannot modify header information – headers already sent by (output started at /var/sites/t/training.xxxxxxx.com/public_html/wp-config.php:5) in /var/sites/t/training.xxxxxxx.com/public_html/wp-includes/functions.php on line 3767
    Error establishing a database connection
    I’m assuming that the headers for the site are being generated by the main site php file, prior to the ones i typed into the subdomain php file?
    Are you able to point me to where I made the mistake from reading the error above?

    1. Sorry for the error that you’re seeing after making changes to the wp-config.php file. Make sure to check the WordPress Codex steps for resolving that error (it’s further down the page when you go to that link). It’s possible that you simply added a few lines that’s causing the error. If you continue to have the problem, please let us know. You can also request help through the live technical support team for immediate assistance.

    2. Sorry for the error you’re receiving after editing the wp-confing.php file in step 8. I checked the error and it’s possible that the problem is being caused by the lines you added. The WordPress Codex has a post about this error and correcting it in this link (you’ll have to scroll down the screen to find it). Please follow their steps in resolving the issue. If the problem persists, you are welcome to contact our live technical support team for immediate assistance.

  12. Great tutorial.

    I followed the steps, but when i try to access my test site i get a msg saying this site is not secure ? I have an SSL certificate on the site i copied from, im sure i read somewhere that SSL certificates dont transfer to subdomains. Any help would be appreciated .

    Regards

     

    1. It’s likely that the copied site is trying to use https when connecting instead of http. This would be the most likely cause for the security warning. It is true that SSLs do not transfer to a different domain unless the SSL is re-keyed for that domain. Subdomains count as a separate domain. You may consider purchasing a new SSL or re-keying the one you already have.

  13. Hello, I followed the steps in the tutorial, but I cannot login to the wordpress admin page for the dev site.  Our WordPress is a new installation, so there is no data on the live site yet.  I then tried setting the live site admin password to a known password, and re-exported and imported the live database. But still cannot login to the dev wordpress.

    1. Check our wp-config.php file to ensure you are connecting to the database you created in “Step 5” above.

      Thank you,
      John-Paul

    1. Hello,

      The process of moving a WordPress site from a subdirectory to another folder is much like migrating your site from another location, but without having move the database since it (the database) will stay in the same location. You can follow the tutorials provided here: Migrating your WordPress site.

      If you have any further questions, please let us know.

  14. Hi, I just followed the directions and I think I did everything right, but I am getting this message: “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.” Please help.

    1. Try looking for a php.ini file in your files. If you find one, rename it to something like php.ini.bak to disable it. Then see if that loads the correct extensions and fixes the site.

  15. I would like to clone my site, and I would like to change at the cloned site the default laguage from polish to german. What have I de to change at the mysql database, to change the default language in the databese from polisch to german.

    1. Hello,

      To change the language of the site you would need to login to the dashboard of the clone and go to settings > general and there will be a “Site Language” option where you can change it to whatever language you would like.

      Best Regards,
      Kyle M

  16. Followed all the steps and everything seemed to be working great. However, when I install a new theme and activate it, it fails to actually apply it. After activating the new theme if I go to the site it shows all the content with no formatting whatsoever. I activated the Twenty Fifteen theme and it looks like this (https://testsite.80cakes.com/)

    I tried installing a few new themes, like Kale and Anissa, however I got fatal errors. For Kale the fatal error was when I went to the site itself:

    Fatal error: Call to undefined function wp_script_add_data() in /home/n0cake5/testsite.80cakes.com/wp-content/themes/kale/functions.php on line 117

     

    When I even tried to active the Anissa theme I got the following and couldn’t even get into my wp-admin so I manually changed the theme in the database:

    Fatal error: Call to undefined function get_parent_theme_file_uri() in /home/n0cake5/testsite.80cakes.com/wp-content/themes/anissa/inc/custom-header.php on line 19

    I realized my version of wordpress is out of date, could that have caused the issue?

    1. It is possible that the missing update could cause a problem. I advise first updating WordPress and then making sure that all the necessary theme files have been copied. Those errors indicate that there are “uncalled functions,” meaning that these functions are being “called” but the files in which they are defined have gone missing.

  17. Hi,

    I followed the steps mentioned above but couldn’t create the test website. The title was displayed correctly at first URL hit but then it shows Server error. My site URL is test.wellapanti.net

    1. Check that the new database you created has data within the tables. You can view the databases in cPanel using PHPmyAdmin.

      Also, confirm that your wp-config has the correct database information. You can view your database name and username in cPanel by clicking the MySQL Databases button.

      Thank you,
      John-Paul

  18. Hi, 

    Thanks for the detailed info!

    Is there anyway that we can hide the dev subdomain from public?

     

    Thank You.

  19. I’ve researched a number of methods on how to do this and this is the CORRECT method. Very detailed instructions and other sources leave out steps or have a tailored approach that isn’t generic or have the wrong order so people get locked out of accounts. After reading around for a couple of hours I was able to put together fragments from various blogs with customized instructions and had a good enough idea to know this was the real deal. I was moving a wordpress site from one directory to another by creating a duplicate database and setting the appropriate links so it ran separate from the main site that I copied. This is ideal for creating a duplicate site for development purposes without disturbing the main site or moving a development site to the main directory after it is complete. The duplicate site if following these instructions has its own database and wp-admin page. It is essentially another website entirely (subirectory or subdomain). this method doesn’t take the shortcut approach of just linking a new directory to the same database. That’s a great way to destroy data in your main database as you mess with the new site (LOL). That method will not work if you want to keep a site running while you edit or make changes to a new site that you want to keep secret. This is a long post but I just want everyone to know that if you are trying to migrate a site from one directory to another the real way this is the solution and it is not difficult!! Great job author.

  20. i’m doing subdomain like https://www.test.abcde.com from https://www.abcde.com

    i follow until step 8, the page isn’t working. 

    there should be something in the screen right?

    then what is multisite and single site? 

     

    1. Hello Dot,

      Step 8 has to do with identifying the database in your wp-config.php file. Are you unable to change it to point to the right database? Please let us know what you’re doing at this step so that we can help you.

      Configure the Test WordPress wp-config.php file for the test site. This needs to be done or the test site will use the main WordPress site database.

      A multisite installation is different (you can see the settings for it in the wp-config.php file). These instructions are NOT for duplicating a multisite (now called “network” ) installation. You can find more information for this type information here.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  21. Hi! I’ve been working on creating a staging environment for an existing site. I have the wp- files copied over, connected the new database and imported the live site database into the staging environment database. The problem is that the sites are not exactly the same. Settings are different for text, for instance. I’m not sure how to proceed from here, or what I could have done wrong?

  22. I am at step 2.  I  created a subdomain called “testsite” but it does not show up as a folder under public_html but as testsite.domain.com at the same folder level as phblic_html.  So, what do I do at this point?

  23. Hi,

    Great tutorial.  I went through it all and it worked when I went to the testsite! However, when I click on any links in the testsite I get a NOT FOUND error. I’ve changed siteurl and home page to have the correct option value for the subdomain site… but still no dice… any thoughts?

    My subdomain can be found at: https://testsite.scratchgarden.com/

     

    Thanks!

    1. Steve, this is only speculation, but there may be an issue with your .htaccess file. I would check the code in that file, and make sure it is set properly. If you’re not sure what the file should look like, I would recommend working with a web developer, or contacting the WordPress community.

  24. Hi, I have been following all your steps and for some reason my test site is reading a different database on my bluehost admin. I’m am trying to create a test site/copy of this website www.absolutenature.co.uk using this test url www.testsite.absolutenature.co.uk but it’s not working. The test site database is called testsite and the live site’s database name is olive2014. I can’t seem to login in to the admin panel but I can using test.absolutenature.dev. However none of the files are showing. So I’m very confused – any ideas? Many thanks, Shelley 

    1. Shelley, I would check at least two things. First, check to make sure that your file permissions, and ownsershipt are set properly. Then I would recommend checking to make sure that you are clearing your local browser cache, and if you have server-side caching to clear that as well.

  25. Were the instructions for this recently changed for the SQL export option?  I used this tutorial numerous times and came back to it recently but I don’t remember choosing “quick” for the export.  When I used the tutorial today it didn’t work so I’m wondering if that is a coincidence or not.

    1. Yes, this should still work for addon sites as well. Check your wp-config file to ensure you are connecting to the right database.

      Thank you,
      John-Paul

  26. Hi, 

    Does this method work for an addon site as well? I’m pretty new to wordpress and cpanel – I have worked with it for less than a year now. 

    My case is that I have a site that is in english (example.com) and I need to copy the entire site that is going to be translated into german (example.de). 

    I tried this method above but without success – I can see the home page, but other links to other pages on the site don’t work and I cannot log in to wp-admin. 

    Maybe there is another and better way to this?

    Best regards, 

    Matija

  27. Yes, I did. I think it might have to do with serialization. The original site and the duplicate site have different name lengths.

  28. Hi! I’ve been working on creating a staging environment for an existing site. I have the wp- files copied over, connected the new database and imported the live site database into the staging environment database. The problem is that the sites are not exactly the same. Settings are different for text, for instance.

    I’m not sure how to proceed from here, or what I could have done wrong?

    1. Susan, are you using a custom theme on your live site? Did you copy over the theme and plugin files from your live site?

    2. Thanks everyone! I did it yesterday and it worked like a charm. (I pieced together a few of the responses here on the forum and then watched the second video on the page Jacob suggests at the top of the questions and answers numerous times before I did it, cause i didn’t want to mess up)

      1. I backed up both the test site and the old site
      2. made a backup folder as well on the server and dragged the files from the old site to there (I’m over cautious can you tell).
      3. Copied the new test site files over to the production site (live site) (waited forever cause it’s a lot of files for this client)
      4. After that finished loading, I updated the options file in myphp on the test database to the correct address and url, and BOOM, all was working again. Had a few strangler icons I had to fix for font awesome, but after that, all looked good and it worked like a charm.

      I can’t thank you enough for this tutorial and support. Thanks so much!

  29. That totally worked, thank you! 

    So now that I’m all finished with this awesome test site, how to do bring over this said test site to my old site and update it? (Both sites, old and test are in subfolders).

    Thanks again! 

     

     

    1. Hello Tara,

      You need to follow the steps to migrate your WordPress site to the new location (your old site). You would need to remove your old site (back it up first) before replacing it with the new one.

      If you have any further questions, please let us know.

      Kindest regards,
      Arnel C.

    2. Thanks Chris, that worked like a charm.
      So this may be a lame and obvious question, but now that I’ve done what I’ve wanted on my test site, how does one push the new things on my test site onto the production site?

      Cheers!
      Tara

  30. Sorry, I never saw your reply on this! Yes, I tried to set up a new DNS record, but it just keeps giving me an error. I’ve kind-of given up on it at this point, but I still appreciate the tutorial!

  31. Hi There! 

    First off, thank you so much for making this video! I’ve been searching high and low for something like this. 

    Everything worked like a charm. The only problem I am having is the home page on the test site keeps redirecting to the live site. All the other pages work fine with the test.domain.com/about (etc) 

    I find that when I change the test sites front page in the general settings section, which ever page I claim and set as the home page, always redirects to the live site. Example, instead of having the “home” page as the front page, I changed the front page to the “about” page. When I go to view it in the test site, it redirects to the original site. 

    I know right now we have a redirect for the main url, is this why? and is there a way around it?

    Any guidance would be amazing. Thanks again for this great tutorial! 

    Cheers,

    Tara

  32. Clear, concise, simple. I even like how you found the home option name fix… me digging in all this code. You made it easy. I’ll be watching the next on how to reverse the process. Thanks!!

  33. Hi there,

    I’m up to step 9 but somehow I am not able to access the test subdomain dashboard. When I enter my username and password is redirects me to the live site. Last night, I changed the URL in the live site (general > settings) to the test site and it went horribly wrong so I’d rather not have to do that again and I couldn’t get back to the main site, everything got re-directed to the test site. All a bit stressful 🙂 

    The test site is test.gingerbeardspreserves.co.uk 

    Any suggestions on what might be happening? Thanks, 

    1. Changing the URL in the test site’s wp_config.php file will have no effect on the live site. Try that and if it still gives issues, you will need to contact your specific hosting support.

  34. Hey guys, great tutorial! Just a small note: the subdomain does not create a folder in the public. So you need to copy the files to the subdomain FULL path /home/usernamehere/domain/subdomainfolder.. (specify), instead of the slash. I just thought to mention that for any other users coming across this

    K

    1. Kristina, thank you very much for your input! It is also important to note that it is also still valid for someone to place their sub-domain folder inside the public_html folder, and they would be able to ‘use the slash’. Alternatively, if someone did place their sub-domain document root direcly inside of their user directory, they should be able to leave off the public_html part, and just leave the folder name relative to the cPanel user directory if they wish.

  35. Brilliant…Thank you for a fantastic video. First time and worked perfectly.

    One question though.

    When I did a search in phpMyAdmin and browse the _postmeta the meta_value column states it’s still referencing the main site and looks like it’s got something to do with the _feedback_contact_form_url. Do I need to go through all of those and update to subdomain name?

    Thanks

  36. Hi, 

    I followed all steps, but the test URL is just forwarding to my live site. I think it might be because I’m using a CDN – how do I stop this from happening? Any ideas?

  37. Thank you for the video.  I followed your steps, the only difference being that I started with a dev site and then attempted to duplicate it to the production site.  I changed the site URL in the database and ensured that it is showing correctly in the WordPress dashboard.  I also even added extra lines in the wpconfig file to ensure that it should be using the production URL. 

    The problem I am seeing is on the new site I can see the pages, but when I hit “view pages”, it loads the pages using the dev URL.  If I remove DEV from the URL, then it says “Page cannot be found”. 

    Production: https://vps24843.inmotionhosting.com/~flashp16

    Dev: https://vps24843.inmotionhosting.com/~flashp16

    Any ideas what I might have missed?

  38. some images are missing after making the subdomain of main website…!!!

    How to get all images from main website to test website..? or from where to change the images links which are present in main website but not in test website..???

  39. I’m working on setting up my subdomain (www.testing.imhannahhunt.com) and am pretty sure I’ve double-checked all the steps, but when I go to test the subdomain, I get the following:

    Sorry, the page you were looking for does not exist or is not available. We performed a web search for “Testing IM Hannah Hunt” and here’s what we found.

    Then a series of AT&T based search results. Any idea why? I know my databases are named correctly (I copy+pasted the database name and the new username (hannahtest) correctly in the code edit…. Just not sure why it’s not connecting.

    I’m also hosted on GoDaddy so a couple steps in the cPanel were slightly longer processes than what was in the video but I didn’t change anything that wasn’t edited in the tutorial…. Thanks!

     

    1. The site is also not resolving in my tests.

      Since your domain is registered with Godaddy, I recommend checking that they have setup the DNS for the subdomain correctly.

      Thank you,
      John-Paul

  40. Hi I’m trying to copy my blog into a new domain, I followed the steps by I got the following error: Fatal error: Call to undefined function apply_filters() in /home/indus406/public_html/lagunahoymx/wp-includes/load.php on line 317 Do you know why this is happening? Thank you so much!

  41. Hmmm…so I’m in the process of manually duplicating a single page WP site.

    • I want to put an exact copy in a sub domain;
    • edit a few details; 
    • then make that sub domain available for someone else to use;
    • The user will not have admin access.

    I asking what would be the most efficient way to accomplisht these outcomes.

    Thx

  42. Dear Inmotion –

    My Site hosted on inmotion www.shilpaahuja.com is a content heavy site (10 GB+) with lots of images, hosted on a dedicated server. 

    Is there a way which help me make a clone of my site, excluding the images – so that it doesnot clog my server space.

    1. Images take up much more space than php files, so copying the files themselves without the images would take up much less space. Copying all the files, excluding the uploads folder, should do that for you. However, the post, pages, etc in the database will still try to reference the images, which can result in broken images on your cloned site.

  43. Hello! Thanks for the great tutorial. I wonder if you could answer a kind-of odd question: I was able to set up the test site and used it successfully. I recently began using a CDN for the site (specifically Cloudflare) and lost access to the test subdirectory. I thought I just had to recreate it so I did, but when I try to go there, it gives me a DNS address not found message. Any thoughts? Thanks!

  44. Where is the video he referenced about showing us how to move everything back over once we’ve gotten the development site how we want it?

  45. Awesome step-by-step instructions!  I was able to sucessfully get this done in a lot less time than I was expecting.

    One question: Do I need to worry about search engines indexing my test site?  I know that’s a big deal topic where I work, but this is my first foray into actually building a site, so I wasn’t 100% sure.  If this is a possible issue, can you offer any suggestions/point me to instructions for making sure that doesn’t happen?  Thanks in advance!

  46. Hoping you can help me out! I followed the tutorial exactly (or so I thought!). At first I was getting a database error, but now when I type the url for the new site, it just drops the first word and directs me to the regular site.

    1. Hello Brett,

      We would need a little information to troubleshoot. Can you describe what you have done so far? Are you hosting with us? Please provide any error messages and steps to duplicate the problem.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  47. Thank you for the tutorial! Everything worked well except that when I go to login to the wp-admin it redirects me to the original site’s login. So, instead of test.eatinonthecheap.com/wp-admin, I go straight to eatinonthecheap.com/wp-admin

    I’ve changed the site url and the home settings in php but I can’t figure out where this problem is. Can you help? Tanks!

    1. This method should work without issue. Ensure you have a clean default htaccess file and that there are no other extra lines of code in there that may cause a conflict.

  48. Hi,

     

    I’ve done everything in the tutorial but when i go to my site it has a 500 error -page not found? I’ve rechecked the db details – all correc. Any idea what I’ve done wrong?

     

     

  49. It was this…

    (‘DB_NAME’, ‘breeder_wrdp1’);

    I changed it to this…

    (‘DB_NAME’, ‘breeder_wrdp1/subdomain’);

    I called my subdomain subdomain

    1. I recommend checking your database name, since it should not include a ‘/’ character. You can view your database names in cPanel. Click the MySQL Databases, then you will see the names listed in the Current Databases section. You are looking for the database you created in “Step 5” above.

      Thank you,
      John-Paul

  50. I did everything step-by-step…watched things over and over…didn’t work.

    I get “error establishing a data base connection”

    I don’t know how to do anything on my own and I do not know what to do now.  🙁

    1. Step 8 specifically addresses your issue. Once you complete steps 8-10 completely, your error should be resolved.

      Thank you,
      John-Paul

  51. I was able to create a development copy correctly usign the process. But now while creating a staging environment, it does not detect that the wordpress is installed and sends me to wp-admin/install.php for installation of wordpress.

     

    If I move ahead with installation, it gives me error message saying tables already exist.

    Please help.

    1. Did you select the new database in the `wp-config.php` file in step 8? It is possible your new installation is looking at the original database.

  52. Hi. I’ve completed my test site and am ready to move it back. Understand the updates on how to do this are not yet ready (video tutorial). I can mostly follow the ‘go back’ steps, but my question is about the files. When cloning the site, I copied all the files and put them in a new directory (“test”). This time I’ll be copying those files and putting them into a directory that already contains files. How does that work? Will it ask me to replace the files and do I say ‘yes’? What folder exactly do I copy them into, the one under “public_html”? And just to be certain, once I copy the files, I then go to the phpMyAdmin, wp_options and change from test.xxx.com to xxx.com? And the same search procedures to change from test.xxx.com to xxx.com? (Please note, I did see the 2014 post from Jacob but am not following it fully…). Thanks in advance for your help!

    Sasha

    1. Hello Sasha,

      Yes, the process is simply the reverse of creating the duplicate site. As far as your files go, when you copy them back to the original folder, they will overwrite the old ones with the new file.

      You will be copying them to the same folder the original files were located. This is most commonly the public_html folder.

      As for the phpMyAdmin changes, yes, you should only have to change the test.example.com back to example.com. That should get you back over and working.

      Kindest Regards,
      Scott M

  53. Hi Scott,

    Thanks for clarifying about the ‘moving it back video’ (and thanks Cheryl for asking). I have just about finished with my test site and will be moving it back over in a matter of days. First time doing this. Do you have any suggestions or resources I could look at to make sure I do it correctly? It was one thing to transfer over and potentially ‘mess up’ my test site, but don’t want to make any errors going back to my primary site of course! Thanks in advance. Sasha

    1. Hi Sasha,

      It truly is essentially the same thing in reverse, so it is not too bad and you can follow the same tutorial keeping that in mind. I do understand about not wanting to mess up both sites in the process, so the best thing is to make a copy of the folder that houses the main site. This way you have a copy to revert back to. This peace of mind makes attempting the move much easier!

      Kindest Regards,
      Scott M

  54. Hey guys! Followed your guide, but my subdomain isn’t working. I just get an 404 Error. 

    I have followed your steps very carefully, both in File Management and MyAdmin.

    The page im trying to get up and running is: dev.unitystudios.com.

    Are there any naming conventions along the way, that i should be aware of?

     

    Best regards

    Andreas 

    1. Did you set up the subdomain in cPanel first? You need to make sure the subdomain is set up and reachable before you can use it as a dev environment. There are no naming conventions needed, only the necessary DNS records to point the subdomain to the right location.

    2. Hello Andreas,

      If your primary domain is not pointed to us, then you would not be creating a subdomain going to us. When I check unitystudios.com, it’s not pointing to us (at least). We have another domain (unitystudios.com.au) with the same name and it shows that the subdomain is not created. In either case, please start with that issue and then you should be able to go through the rest of the directions to create the duplicate site.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  55. Towards the end of the video where you were doing the search of the old url in the test database: Besides ninja forms, it is showing 57 matches in wp_commentmeta; 1 match in wp_comments; 41 matches in wp_posts and 1 match in wp_users.

    Is it not necessary to change to the test url in the aforesaid tables?

    1. Hello Edwin,

      Jeff (in the video) is searching for his domain name in that search. He was looking to remove it because he had cloned the site based on his domain. It will need to be changed to a DIFFERENT domain for your new test site. You should replace that old URL with the new one that you’re using for your test site. Jeff is saying that many of found values are the result of a positive where it’s using his email address – which isn’t a problem for the operation of the site. He left them because he can still access the email and it’s not critical to change them.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  56. Excellent tutorial, Jeff! I’m a complete newb dealing with databases and networks, and I was able to follow along easily and everything (so far!) has worked out great. One thing to keep in mind, in the video at the end in the SEARCH for the old url, you didn’t mention what kinds of things to look out for. I had a lot of results come up – most were in my posts – but I wasn’t sure which ones I needed to change. I had to refer to the written instructions below and get the SQL code for the posts. But still, excellent tutorial. Very helpful!

    One question: I already have a pretty big site, what if I just want to export like a single page, or only a few posts back to the original site, instead of the entire site. Is that possible? Let me know. thanks guys! 

    1. The guide above will not allow you to choose which pages are migrated.

      It is possible to export, then import content from the WordPress Dashboard.

      Thank you,
      John-Paul

  57. Fantastic video! Thank you! Do you have the link to the video Jeff mentions at the end to move everything back to Production? I realize it is kind of the same steps but would appreciate the help for the first time I do it.

    Thank you

    1. Hi Cheryl,
      Jeff never got to make that second video. We are planning on redoing this one to bring it up to date and to have the second one as well.

      Kindest Regards,
      Scott M

  58. And what about indexing? What is the best way to make sure the subdomain (test site) will not be indexed from search engines?

    1. You can add a robots.txt file to your sites main folder and set it to not allow crawlers. Keep in mind this is more of a request though, as search engines can still index if they want to. Good engines, however should abide by your request.

  59. Excellent walkthrough! I was able to successfully complete this with my Bluehost hosted WordPress site. Thank you so much for the guide!

  60. This is what pops up.

    test.chromacomm.com’s server DNS address could not be found.

     

    DNS_PROBE_FINISHED_NXDOMAIN
    1. Stefan, you will want to check with your hosting company to see why the subdomain DNS is not propagated. Perhaps they can push it so it resolves for you.

  61. I followed the video step by step and have read all post and I have had none of the issues mentioned, but I still dont see my test website yet. Is there another video to watch that I will be able to test the process please?

    Thanks

  62. I followed the instructions in the video above, but when I tried to access my website in the subdomain (dev), I got a prompt to start the five-minute install. How should I interpret this & how do I fix it?

    1. Hello Signsanssignfied,

      The problem may be related to the database assignment for your installation. You need to make sure that the database is correct, or the installation will try to start over again. Double-check all of your configuration settings and let us know if you continue to have any problems.

      If you have any further questions, please let us know.

      Kindest regards,
      Arnel C.

  63. Thanks for the great video! Everything worked perfectly for this newbie.  2 questions.  #1 Now that I’m in my test environment, I have done a few updates to content on my live site, in the meantime, while I’m still in testing.    How do I update my test environment with these new content changes to see how they’ll look on the new site? 

    #2 If I’ve made live changes like…deleted plug-ins, posts or pages, how do I transfer those changes over to the test environment.  I tried and got some SQL errors, so I’m not sure what I’m doing wrong. I really want the site content to mirror each other so when I move everything over, it’ll be up to date. 

    Thanks. 

     

    1. Hello Candice,

      Thanks for your questions about the test WordPress site. #1 – Whatever assets you’ve changed on the live site, you should be able to load on the test site. Content is general created or uploaded in WordPress. It’s no different on your test site. Were you having specific problems making the same changes?

      #2 – If you delete plugins, you can do the same thing in your Test site, but you need to do it through the provided WordPress interface – you have to login to the Admin go to plugins and remove the plugin if you’re trying to remove one. Don’t make changes directly in the database unless you’re simply making text updates. Above all else – since it seems like you’re experimenting – make sure to have a backup of your sites so that you can restore to a certain point if necessary.

      If you’re still having difficulty making changes from one site to the other, please describe EXACTLY what you are doing when you try to mimic the changes on the test site.

      If you have any further questions, please let us know.

      Kindest regards,
      Arnel C.

  64. I am an inexperienced web developer and have been looking at how to do this for so long. THANK YOU Jeff!!! Simple to follow and worked perfectly! I have bookmarked your site so I can follow the next stage video when ready.

  65. hi

    after all has been moved to other storage with same cpanel i cannot see the installtion in the Installations link — Current

    how can i fix it

    thanks

    eran

  66. Hi, great tutorial and easy to follow.

    It’s not quite working out for me though, when I try to go to my test site test.saferemedies.com it still takes me to saferemedies.com.

    The only thing I can see that I have done wrong is I copied all folders and files over (bar the new test folder), I didn’t see that it was supposed to be wordpress folders only. Here are a list of the fodlers and files that have been copied over. Could you tell me if any of these need to be removed to get this working?

    https://www.dropbox.com/s/u81qlkn4miliqgd/filemanager1.jpg?dl=0

    https://www.dropbox.com/s/gbkdcyz2olki4c7/filemanager2.jpg?dl=0

    Thanks, Derek

     

    1. Hello DerekS,

      Thank you for contacting us. If your site is redirecting to the original domain, ensure you have completed the full guide above, specifically step 9. This should cause the site to resolve to the test address.

      Thank you,
      John-Paul

  67. I uploaded my test site and all my portfolio pages /post are gone/broken. When I searched my original domain in phpmyadmin under the search database it shows: 681 matches inside table wp_posts and 36 matches inside table wp_postmeta. Do I have to change ALL of them to my new subdomain to get them to work which will take forever to get them to work? Is there a shortcut? In the tutorial it wasn’t clear which occurences of the old domain we could leave as is and which ones we had to change, besides the homepage. I don’t understand with the cloning which things got changed to the domain and which ones stayed the same and why.

    Thanks,

    Denise

    1. Hello Denise,

      Sorry for the problem with your links. Generally, many sites that are cloned don’t include all of the content, but that is not always the case. So, when you clone a site from one location to another, the core files stay the same, but the wp-config.php needs to change for the new location, the content files need to be moved, and the database needs to moved. The content files also remain the same, but the references in the database for the content files (e.g. images) need to be updated to the new location. Although you have a lot of files that need to be changed, it’s actually relatively quick and easy to make the changes using a little SQL code. You can find out how to do that using this tutorial – it’s about correcting image links, but the provided code can be easily modified to update other portions of the database as necessary. You may also consider a WordPress plugin like Better Search Replace. This is a very simple plugin that lets you update URLs ro text within the WordPress database.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Regards,
      Arnel C.

  68. Hi Arnel,

     

    Thanks very much for your quick answer. What will you recommend me in case of multisite? To test before making any changes on the real one?

     

    Thanks again

    1. Hello Susan,

      Thank you for contacting us. Just be sure to backup any site files/databases before proceeding with any tests.

      This will allow you to revert back if there are any issues.

      Thank you,
      John-Paul

  69. Really good video!! Seem very clear but still scared for now. I have few questions. I have a multisite with a subfolder, both are linked with a language plug in and I was wondering if in this case I can follow this video as well.

    Also, I have created the subdomain in order to ad the test site, but I have installed wordpress on it already to have other password. Should I then delete everything is there and just follow the video? Then the log in in wordpress will be the same as for the real site? This part is not clear for me as I’m really new on this.

     

    Thanks very much for your help.

    1. Hello Susan,

      The confusing here is that people often try to simply duplicate WordPress sites WITHIN the Multisite installation. This is the reason for the warning up top. The instructions were really made for TWO individual installations of WordPress not using multisite. I would not recommend using these instructions on your multisite installation.

      If you have any further questions, please let us know.

      Kindest regards,
      Arnel C.

  70. It is possible through cpanel and softaculous (or installatron) to create a clone of the original site and specify a new directory for it to sit in.

    I have done this several times and find it has always been a simple ‘one button’ press solution.

    Go to softaculous, and next to your current wordpress installation you will se a clone button (next to back up and delete). I’m not sure if this only works if you originally installed wordpress through softaculuos though.

     

  71. reating the newsite to build under a subdomain was easy.. I did it and created the site.  BUT now I have tried to bring that site to the URL of old site and I now cannot open anything .. I don’t know what I have done wrong.. I have watched the video and tried to reverse it a few times.. I have I though followed all teh right steps but I simply get a blank page now.. my website URL old is https://www.srdsindia.org and the new one was newsite.srdsindia.org.  I will contact my server to see if they can see what I might have done wrong but if you have any insight it would be much appreciated.

    I also did the steps for converting the images files to the new url but this possibly does not seem to have worked as on a search in php my admin there are still many image files with the wrong pa

  72. You guys are awesome!  I did it, and I’ve never built a site before.  This is my first time learning how to build a wordpress site.  I was stuck on building a test environment, but following your steps, I did it!

  73. I’m pretty sure I did everything correctly.  I didn’t get any errors messages.  However, when I try to open www.test.vintagerocksinteriors.com it redirects to my main site of www.vintagerocksinteriors.com.  Any ideas?

    1. Yes, it is likely that the database is still calling for the latter domain, www.vintagerocksinteriors.com. I advise going through steps 5-10 again to make sure you have made the necessary changes in wp-config and your database.

  74. Hi, I have followed the steps and created  staging folder and a subdomain as staging.fiadotech.com

    but when I go into the dashboard of staging I cannot see any pages and content of my website but if I go the staging.fiadotech.com, I can see the pages. Pls tell me how do I get the content also duplicated here or is it that we have to change in the main dashboard and it will reflect here which I dont believe is true.

    Regards,

    Indu

    1. Which content is missing? It sounds like you can see the site at staging.fiadotech.com. I’m not sure what you’re lacking exactly. Would you be able to clarify the issue?

  75. I followed your directions and worked like a charm!  Even for a never ever Website/wordpress player.  So i created my test.domain.com site and our old/live domain.com site is still going.  Now i think i am ready to go load our test site onto our old domain.com site.  I don’t need to keep anything from the old site.  Everything i have on the test.domain.com site is what I would like to keep.  

    How do i do this?  Thanks in advance

  76. Hi Guys, thank you for the great tutorial. I think all most everything worked out. There is a testsite and seperate database, some fonts look different and some image links are broken but that is fine. The problem I now have is that it will not allow me to log in to wp. I get the following error (I took out the name of the site hope that is no problem): The website encountered an error while retrievinghttps://testsite.sitename.com/wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F. It may be down for maintenance or configured incorrectly.

    Would you have any idea where I have gone wrong? The environment I had to do it in is a bit different then the Cpanel but I followed all the same logic and steps.

    Thank you!

  77. Hello – so glad to find this post. 

    I have set up a 2nd site at dev.mymainURL.com and have been using that space to build a new version of the site (new framework and theme, content, plugins, etc.) 

    My question now is how do I make that newer version of the site (which currently lives at dev.mymainURL.com) live? Do you happen to have a post about that?  (FYI – the original version of the site uses WordPress, but is a custom build that someone else did…)

    TKS!!

     

     

  78. Got it! Holy cow that was a bit challenging. Most of it was follow right along, but the sections where I need to click and the video has them blurred out made it hard to follow, particularly around 8:30 in the vid. Got an Error Establishing Network Connection, because in the video you can’t see what he is typing or where.

    Not to worry, got it fixed and am grateful for the tutorial!

  79. Hi.  I followed your video completely and the test site doesn’t show up at all.  Just a dummy page from bluehost.  And my actual website?  Gone!  It says error establishing a database connection.  I am freaking out!

  80. Great tutorial, it worked for me.

    Kudos to u.

     

    Initially i got an error, error in database connection, then i checked that i made mistake in writing the name of the database in code edit for test database.

     

    everything is working smooth.

     

    I took the back up because i wanted to change the name of my website ****.com/wp  to ****.com

     

    First step is done, hoping to get a good tutorial like this to help me in doing that too.

     

    Thanks Again 🙂

  81. Hello.

    Can you help me.

    I had an website: tranggiadung.vn and I tried to clone to tranggiadung.vn\lab

    I did step by step but it show page not found and I can not access tranggiadung.vn\lab\wp-admin to login.

    Can you help me some idea?

     

    Thanks

    1. Hello Kien,

      It’s possible the URL of the test site is not configured for the new location. Did you follow the steps in the below link:

      https://www.inmotionhosting.com/support/website/wordpress/wordpress-changing-the-site-url-and-home-settings

      If so, I would check to make sure all the files copied correctly.

    1. Hello Altug,

      If you installed the duplicate site properly, then you should be able to login to the administrator in order to access Woocommerce and WPML.

  82. Okay, I seem to have figured out the above, but now when I try to preview the website in WordPress it will only show a page Index of /testing1/ followed by the folders and files in the testing1 folder. Any ideas?

    1. Hello Alison,

      If you’re seeing that for your page, then you’re missing the default WordPress index file. It’s normally part of the WordPress installation. If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  83. Hi TJEdens,

    thank you for your time.

    I give up, delete it, and start all over again and now it works! I think that I made mistake somewhere at copying files from public-html to test folder.

    No matter on that, thank you once again on tutorial. It was very useful for me!

    Kind regards,

    Ivan

  84. Hello, I have done exactly like you explained. My web site have subdomain test.domain.com but when I try to access test.subdomain.com/wp-admin to edit content on it says 403 forbidden error “You don’t have permission to access /wp-admin/ on this server.” I also tried domain.com/test/wp-admin and still get the same message. Where did I make mistake? Thank you.

  85. Hi All, 

    I followed the instructions and have recieved no error messages, but now I can’t figure out how to actually access the testing version of the site that I created? I would like the testing sebsite to remain “invisible” and the current website to remain functional, until such time as I have completed the changes I would like to make and would liek the new and improved website that I plan to develop on the testing subdomain to go live. 

     

    With Thanks

    1. Hello Alison,

      If you have the test site under a subfolder, such as domain.com/test, then the admin area would be located at domain.com/test/wp-admin.

      Unless someone knows about the subfolder, then it will not display publicly. Be sure to set the General Settings to not index the site.

      Kindest Regards,
      Scott M

  86. Hi Guys,

    Great tutorial, but I’m running into a problem. Followed these steps:

    – Copy public_html root (files and folders) to new location (subdomain)
    – Create database
    – Export current database

    At this point I was able to connect to my test website (test.mywebsite.com) and saw the default WP login. But the next step makes my site accessible with an error 500.

    When I import the current database and change the siteurl and home field in the database, my site is no longer accessible. 

    I’m trying to make a dev site and eventualy want to create a cronjob to copy the database daily or weekly.

    What am i doing wrong?

    Kind regards,
    Remco

    1. Hello Remco,

      Sorry for the problem that you’re seeing in coping the site. I just tested these directions and they were working for me. I think the only thing that might be confusing is the use of the subdomain name. If you did not define that subdomain in the cPanel, then you may have problems. I personally simply used the following naming pattern in my test:

      https://example.com/copyme (original site)
      https://example.com/thecopy (copied site)

      Make sure to define your subdomain in the cPanel and then try changing it. You can also try using the Softaculous option in cPanel (available for free in shared server accounts). There is a tutorial called How to clone your site with Softaculous. One last note, if you’re using a custom .htaccess, it may also affect how your WordPress site is being called. Make sure that an .htaccess file isn’t causing the error you’re seeing.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Regards,
      Arnel C.

  87. Thank you for this great tutorial! It really simplified the whole copying process.

    I have a few basic beginner questions. I currently have a site and I’ve set up a test site. However, wp-admin links back to the original site and not to the test? I’m a bit confused as to whether I should be getting a new test/wp-admin dashboard or not.

    The main concern is that I’d like to keep the changes made to both sites separate (while keeping the original running), and I keep wondering if that’s only possible by reinstalling wordpress in the subdirectory. Please advise.

    Thank you!

    1. Hello Delphine,

      You will want to ensure you have followed all the instructions and have the URL settings pointed to the new URL. Any links that have hardcoded URLs will need to be manually changed, however as they will not follow the changes in the settings.

      Kindest Regards,
      Scott M

    2. Hi Guys,

      Thanks for this great tutorial.

      I am a little confused as to how I should be logging in though (apologies – I’m a relative beginner!)

      should I be going to test.mysite.com/wp-admin or mysite.com/test/wp-admin. If I go to the first one it logs me into my main site editor and if the second one it says there is an error establishing database connection.

      I have followed the instructions and manually changed the urls as per step 9 – what am I doing wrong?

      Thanks in advance

      Rose

    3. Ok I’ve managed to fix the error so now when I go to test.mysite.com/wp-admin I use my normal wordpress log in details but when I click ‘log in’ nothing happens. The eggtimer goes around and it looks like it is going to load but it just takes me straight back to the log in page.

      Thanks,

      Rose

    4. Hello Rose,

      That should not happen. I’m assuming that this does not happen on your live version. By chance are you running this copy on a different php version?

      Kindest Regards,
      Scott M

    5. Hello Rose,

      At this point you would need someone in support to take a look. They will need to get with you on the login credentials so they can attempt to log in and make any adjustments needed. If you are one of our customers, contact Live Support. If not, be sure to reach out to your hosting support so they can take a look.

      Kindest Regards,
      Scott Mi

  88. Fair enough, the slight hiccup cost me only about 5 minutes other than that it was spot in. Still very useful tutorial. Thanks

  89. This brought be great happiness after some frustration, did the job near perfectly except for Text Widgets not coming accross. They did have old urls in them but did the search thing and changed the urls to new ones and they still did not appear. 

    I just create new copies in the end but if there is a way this can be done as well for the future that’d be appreciated. Thanks all for your help!

    1. Hello Daniel,

      Unfortunately sometimes a migration does not transfer perfectly as I recently moved one and it was missing a few images randomly. It can vary from process to process.

      Best Regards,
      TJ Edens

  90. thanks for the tutorial!! Just a quick heads up that though you’ve blurred out your sensitive info throughout the rest of the video, your password is visible at 4:00. 

    1. Hello Melissa,

      Thank you for contacting us and letting us know. This is just a test account, so it is no longer active.

      Thank you,
      John-Paul

  91. My basic thing is, I have a site that I want to completely do over. But it was hosted by wordpress.com not wordpress.org before I signed up here.  I want to keep the domain but I have a theme I purchased that I’d like to basically redesign the site. (I requested the domain be transfered to Inmotion through domain concierge). 

    Okay, so I set up a sub-domain and set up a database, but then, I got stuck at exporting the current wordpress database. And I don’t know if that will work anyway since it was originally a wordpress.com site. I went to the tutorial, but I got stuck at step 2: Select the database you are currently working with…

    Is there some way to start with a fresh template and later import blogposts from the wordpress.com site. WHich I would delete but I want to keep the domain…

    I hope you can follow that. Am I barking up the worng tree. I’m new to this.

    website>>> www.rigorouseducation.com

    1. Hello Aaron,

      Check out our article on moving from WordPress.com to our servers. The data export will come over as an XML file and can be imported right into the database here.

      If worse comes to worst you can always just copy the post text from the .com admin area and copy it into a post on your new site.

      The article should be the easiest way, so be sure to comment below if you have any questions or concerns about it.

      Kindest Regards,
      Scott M

  92. This tuturial is absolutely great. However, I am having an issue. The issue states…
    This webpage is not available
    ERR_NAME_NOT_RESOLVED

    Then the details states…
    The server at test.*****.com can’t be found, because the DNS lookup failed. DNS is the network service that translates a website’s name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventingGoogle Chrome from accessing the network.
     

    Is there a way to fix this?

  93. Can this process also be used to create a secondary website with a different domain?  I run my own business and mostly manage my website myself.  I have two aspects of my work and want to split off one into a separate website so the SEO is different but basically want the same structure and CSS.  I’m essentially wanting to do the idea of a copy and paste to my new domain then simply change the content in the pages.  Could it be this simple?

  94. Hello John-Paul,

     

    Thank you for the response.


    I checked “Step 9” again, per your advice.  It looks like there are 4 possible ways to change it:

     

    1) Change WordPress address with wp-config.php file – I had already done this

     

    2) Change WordPress address in admin dashboard – I cannot access the admin dashboard

     

    3) Change WordPress address directly in the Database – I just did this

     

    4) Detect and change WordPress address with RELOCATE – I am not sure I understand this one.  Perhaps you can help shed some light on it?  It says to get the MySQL settings from my web host.

     

    At any rate, I still cannot log into the wp-admin side.  Is there something else I can try?

     

    Thank you,

     

    JJ

    1. Hello Dien,

      Yes you are correct, if you do not want to import the data from another site, simply installing two different instances will work fine.

      Kindest Regards,
      Scott M

    2. Hello JJ,

      It sounds as if you have done enough to have it work correctly. You will want to contact support to have them take a look at your individual account.

      Kindest Regards,
      Scott M

  95. Sorry I wasn’t clear. I would like to install a new WP theme of a new Website and use the same theme to install to a Subdomain site for testing purposes. So there are two identical brand new sites. Can it be as simple as that?  I don’t see why to move or copy database if they are both brand new sites. 

  96. Instead of coping the files and move them, can I just install two WPs one for the main site and one for the test_subdomain site?  

    1. Hello Dien,

      Yes, you can install two different WP installs and then import your contents, and database. Unless you can simply use a blank WP installation. I hope that helps to answer your question! If you require further assistance, please let us know!

      Regards,
      Arnel C.

    1. Hello JJ,

      Thank you for contacting us. Ensure you have completed “Step 9” above, as it updates the URL and stops the redirects.

      If you do not have an SSL for the test domain, be sure to use “http” instead of “https” in the URL.

      Thank you,
      John-Paul

  97. Hi there,

    I am glad that I found this tutorial. I started following the steps and at the point of importing DB, I got stack. When I clicked ‘Go’ to import, the spinning icon was going on for long time and it never loaded. Well, I ahve to close the window after waiting for 30 min. I noticed that ned to ‘browse’button, it says “Max 50MiB”. Could it be that the file size more than 50 MB cannot be uploaded?

    Regards, Yumiko

  98. Thanks for this!  I was able to use it successfully to create a backup site on a subdomain a few months ago.  Now I’d like to do it for a different site, and I’ve tried twice; but each time when I go to log in to the wp-admin side, it goes to the login for the original site (and the admin side of the original site).

    The original site has an SSL that does not extend to subdomains.  I don’t know if perhaps there’s a redirect somewhere that is causing the problem?  If so, where might it be?  I have edited the .htaccess file to take out a rewrite rule.  I have also double checked to make sure I didn’t skip the above steps.  Do you have any suggestions?

    Thanks in advance for any help you might be able to provide, and for posting this guide in the first place. 🙂

  99. Hello I followed the above video guide I’m able to copy the complete site on to my test environment. But, I’m not able to access the pages. I get the following error:
    ________________________________________________________________
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
    More information about this error may be available in the server error log.
    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    __________________________________________________
     
    I have changed the site URL and the Home URL but still I get the above error. Please help me with this.
     

    1. Hello Chandan,

      Sorry for the problems with your WordPress site. We would need more information about the exact steps you took to make the duplicate copy. You can find these same directions in the WordPress Codex (under Moving WordPress), so if you’re getting an Internal server error, there’s something missing somewhere, or another factor causing the error. It’s also a very general error. You might want to consult with your host’s technical support (since you’re not hosted with us so that we could look at your files) to see the specific issue causing the error.

      Apologies that I can’t give you a more direct answer, but we would need to be able to see your installation in order to quickly determine the source of the issue.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  100. This is such a great video! Very helpful and so clear. Have you had a chance to make the video you mention at the end? That teaches us how to move our dev site onto the root?

    Thanks for all your help! 

    1. Hello Emily,

      We have not had a chance to make that video at this time, however moving the wordpress website to the root directory is a fairly simple task. You can read up on how to do in this WordPress Codex.

      Best Regards,
      TJ Edens

  101. I did already mention that I had successfully used wp-migrate-db to fix my original issue! At this point I think I have database migration under control; it’s the importing and exporting of pages using WXR XML files that’s my goal at the moment.

    I’m having trouble working in the production environment because for some reason when I hit “preview changes,” it functions as if I hit “update” — the edits go live immediately. And even if Preview DID work, the user is still only allowed to save drafts of pages if the page hasn’t been published yet. I want to be able to edit existing pages, sometimes rather drastically, without worrying about making them look terrible in the interim period — for example, we’re in the process of taking official pictures of our staff, and I’d like to be able to add the pictures as we take them, rather than have to do it all at once, but I also don’t want to have a live page that’s clearly missing pictures, you know?

    Our site isn’t THAT highly trafficked, so normally I don’t feel too worried about risking live-site corrections, but not being able to save drafts of edits for existing pages is a pretty big problem. Hence my interest in quicker import/export workarounds to get between the dev site and the production site.

    I know you guys aren’t my personal WordPress help desk, so I’m not expecting you to solve all my problems! If you happen to know a good workaround, though, do let me know 🙂

    Thanks again for your help!

  102. I was able to make things work by dropping all my tables and re-importing them using the wp-migrate-db plugin.

    Now I’m trying to figure out how best to push updates from the dev site to the production site — small updates, not whole-site updates that might merit doing this entire process in reverse. I’m experimenting with the built-in WordPress Importer in combination with a WordPress Exporter plugin customized to allow exporting individual pages, but now the problem is that WordPress Importer doesn’t let you overwrite existing files. 

    I’m trying to tweak the wordpress-importer.php file to allow me to overwrite things as promposed by a commenter on WordPress Support several years ago when the code was apparently very different (https://wordpress.org/support/topic/can-i-overwrite-existing-posts-with-import-tool), but I’m not exactly a PHP pro; do you know if this is likely to brick my site?

    Really I wanted to ask how that follow-up video on the reverse process is coming along. On the comments on the YouTube page someone said about a month ago that filming was going to begin in the coming weeks — is that still true?

    1. Hello Webdev minion,

      I’ll start with your last question about the video. I’m sure you’re probably familiar with ever changing thing called “priority”. If the video you’re referring to has not yet been shot, then it was simply moved back on the board because of other priorities. Our apologies for any delay there.

      In regards to the whole “production” and “development” environment. If you are doing massive changes to the website theme that would interfere with the operation of the existing site, then it would be wiser to work in that manner. However, if your intent is only to change a few pages or posts within the WordPress site, then I would I highly recommend that you work within the WordPress structures (unless there’s some other prohibitive factor that I don’t know about). WordPress was made so that you can you have multiple pages/posts in development without interfering in the displayed website. You can always publish pages (or posts) and allow only certain people to have access to view them.

      Again, I’m only saying this based on a typical WordPress site. I do not know what development is required or needed for your site. So my apologies if I’m not providing you any decent feedback. Since you’re doing database importing and exporting from one location to another, you may want to explore using the WP Migrate DB plugin or All-in-one WP Migration. There are a bunch of other great db tools such as the WP-DB manager plugin. Many of these tools are very forgiving and easy for the novice to use.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Regards,
      Arnel C.

  103. Sadly, flipping back and forth between themes did not make the missing elements suddenly appear. It’s like the site just lost upwards of half its content for no discernible reason. Something to do with how WordPress recognizes whether or not elements are added to the backend of the CMS?

    1. Hello Webdev minion,

      WordPress recognizes added elements through the database. Are you seeing placeholders for the elements? If so, then it’s a matter of putting the added items in the correct location. Anything added tot he site (graphics/audio/video) are saved in the wp-contents folder – and usually in a specific sub-folder. Check that out and let us know if you continue to require assistance.

      Regards,
      Arnel C.

  104. Thanks so much for this great tutorial!

    I seem to have been able to follow all the steps, but it seems that none of the “elements” added to any of the pages — image boxes, sliders, etc — are showing up on my test site. The main body text shows up, but nothing else does. 

    I can log in to WordPress fine and every file path I try seems to work, whether images or css pages or what have you. I changed all the absolute URLs using the method in the video (except for those in wp-posts, because the video also seemed to skip those) so I don’t think that’s the problem. And it seems that all the files from the old site are duplicated for the new site; they both have exactly the same number of files and seem to be the same size.

    Having to recreate all the elements again seems to undercut a great deal of the usefulness of porting the site over like this; I hope there’s an obvious fix!

    Our home page is here: https://www.forfamilies.org

    and the test site is here: https://test.forfamilies.org

    1. Hello Dee,

      Have you tried logging into the development administrator dashboard and changing the theme to a system default theme? This should fix the issue at hand.

      Best Regards,
      TJ Edens

    2. Hello Webdev,

      Have you tried changing the theme to something such as the default theme and switching it back? Please let us know how it looks on the default theme versus the custom installed one.

      Best Regards,
      TJ Edens

    3. Hi Tj,

      That’s what I would want to try for now but unfortunately I cannot log in with the same details as my main WP site.

      🙁 Dee

    4. Hi TJ,
      I think I have a track to why my dev site isn’t showing up. I went to check wp-content/themes of my dev site and saw that the files from the main site were NOT copied. The file permissions of these folders are 555, do you recommend changing the permission so I can copy the theme files? If so, could you help me out on how to change permission of all its subfolders at the same time?

      Thank you so much for the help!
      Dee

  105. Hello and thank you for the tutorial!

    I followed the steps but something is not quite right. When I log in to the new site and make a change, it affects both the new site and the old one. I did create a new database, export / import, modify the wp-config, etc. But something is not right. Any ideas?

     

    Funny thing is I did this a few months ago and it worked great. I must have missed something this time but for the life of me I can’t figure out what is missing. Thanks for your time, in advance!

    James

     

     

    1. Hello James,

      I would suggest checking your database information in the wp-config.php file as if you are making changes and it is affecting the main website then the database is still connected to the main website.

      Best Regards,
      TJ Edens

    2. Hello Dee,

      The only time you need to wait for propagation is when you modify DNS records. Can you provide us a url so we may look into the problem?

      Best Regards,
      TJ Edens

    3. Hi TJEdens,
      Thanks for getting back to me.
      Here’s my main site:
      https://www.craighwilson.com
      dev site: https://dev.craighwilson.com
      dev site is just a blank page. it doesn’t even show an error so I’m not sure what went wrong upon set up. Please help 🙂
      Thank you!
      Dee

    4. Here’s my main site:
      https://www.craighwilson.com
      dev site: https://dev.craighwilson.com
      dev site is just a blank page. it doesn’t even show an error so I’m not sure what went wrong upon set up. Please help 🙂
      Thank you!
      Dee

  106. Hi there, really hoping someone can please help !!!
    I have created a test subdomain,but I cannot log in to wordpress and the main point of creating this test is to test new themes but I can’t log in.
    Everytime I type in test.***.com/wp-admin it redirects to https://www.****.com/wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F
    and  gives me the following message: 
    No Update Required
    Your WordPress database is already up-to-date!
    Continue
     
    so if i click continue it redirects to my main site. 
    I have tried typing in https://www.test.***com/wp-login.php and it gives me the option to log in to wordpress but as soon as I type in my information , it redirects and automatically logs me into my main site.
    I have also tried in c-panel to change test.***.com redirect to test.***.com and still it is not working, it appears to have only added more information to URL 
    https://test.***.com/www.test.***.com
    Can someone please offer a suggestion!!!!

    1. Hell Mel,

      Thank you for contacting us. This often means the test site URL is still set to the original domain.

      You will have to Change the site URL for the test site as explained in Step 9 above.

      I also recommend undoing any redirects/changes you made in the cPanel, before proceeding.

      Thank you,
      John-Paul

    2. Hi!

      Thank you for this tutorial.
      I have done all steps, however the dev site I made doesn’t load. But i can access the log in page, though error when logging in.
      Does this mean the site works but I needs time to propagate?

      Any help will be greatly appreciated.

      Thank You

      Dee

  107. just a quick note if you need to replace you site url on lots of places you can run a simple command, just have look short tutorial 

    https://codex.wordpress.org/Changing_The_Site_URL

  108. Hi TJ,thanks for your reply. I had a chat with Larry (IMH chat) and the problem was solved. So yeah no more error visible.

    Greta

    1. Hello João,

      Sorry for the problem that you’re having problems with the duplicate site. We do need a little more info in order to determine why you’re having the problem you’re seeing. Can you provide the URLs involved with the duplicate site versus the original? If you’re making changes on the duplicate site, but seeing nothing applied, then it may be possible that you’re looking at the original website. Please make sure that any changes you are making are occurring within a specific domain. If they’re occurring in one location, but not being written, then either it’s a database issue or you’re making the change and then not looking at the correct site where the change has been made.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Regards,
      Arnel C.

  109. Yes i have oppened it on incognito mode but it doesn’t work

     

    It’s strange because i edited the menu and slider and it was ok, but when i try to delete a image or text and then do update it puts everything back

     

  110. Hi

    I did all the process and I have the site duplicated. In the new subdomain I can edit everything (menus, plugins, etc) but when I try to edit a page (for example delete an element) and i do update it puts the item back

     

    Can anyone help?

    1. Hello Greta,

      I am not able to replicate a database connection error as I can see your wordpress website loading. Can you please provide a url that is currently not working?

      Best Regards,
      TJ Edens

    2. Hello João,

      Have you tried opening your duplicate website in your browsers incognito mode? This will load the page with no cookies or cache. Also if you have any caching plugin installed, deactivate it.

      Best Regards,
      TJ Edens

  111. Hi,
    Great video tutorial but unfortunately after following the instructions twice, I am still getting this message on my test version: 
    Error establishing a database connection
    Website link: test.barcelona-unleashed.com. For information, on the production version I created I added a passord protection using aksapache online tool.
    Thank you in advance for your help!
    Greta

  112. Nevermind, I totally figured it ut….had a blonde moment and tried typing in the login for my cpanel. All is good!

  113. I’ve got good news and bad news. Good news first! I looks like everything copied over flawlesly! Bad news is, I can’t login into my test site, going to test.mydomain.com/wp-admin. I put in the password and user we created for the test site and I also tried the user and password for my live site. nothings working. Can you offer any advice?

     

     

  114. I have a quick question, test created fine, production site had loads of new posts and pages and so I Wanted to update the test site.  When I came to importing the production db sql file it errored becuase of duplicates found.  Do I need to drop the tables already in the test schema and import into an empty db?  I thought I would be able to over write them. 

    Thanks for your help.

    Richard

    1. Hello Richard,

      Thank you for your question. Yes, if the table already exists it can cause problems. Typically, you would import into an empty table. In order to overwrite, you would have to custom-code this into an SQL statement or process.

      Thank you,
      John-Paul

  115. Fantastic.

    It worked for me perfectly. I spent so much time looking for a tutorial like this. Finally I found you!

    Thanks

  116. Hi, I am having the same issue with a client’s site. I created the subdomain three days ago, and I am still getting a DNS lookup failure error. Ideas?

    1. Hello Amanda,

      I’m sorry you’re having the problem with the subdomain. However, you have given us NO information about your domain name, subdomain, or the exact error message you’re getting. If you could provide us more details about the issue, then we would be happy to investigate the issue further.

      Regards,
      Arnel C.

    2. Hi again,

      the subdomain is drlochhead.idneuro.com.

      the error is : This webpage is not available
      The server at drlochhead.idneuro.com can’t be found, because the DNS lookup failed. DNS is the network service that translates a website’s name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Google Chrome from accessing the network.

      Thank you,

      Amanda

    3. Hello Amanda,

      If you have created the subdomain and it is still not propagating through the DNS, you will want to conact our Live Support team to have them do a push for you. Sometimes DNS just doesn’t push out like it should.

      Kindest Regards,
      Scott M

  117. At the 11:00 mark in the video, Jeff says in the next video, he will show us how to move everything back. I am waiting for that, too. He did such a great job on this one, and I ma ready to migrate my site back as well.

    Thanks.

    1. Hello kiboko,

      Thank you for your question. If it is referencing the incorrect folder path, ensure you have completed Steps 8-10 in the above guide.

      They are quite detailed, but should correct your issues.

      Thank you,
      John-Paul

  118. Hi,

    I created test database:

    https://test.accommodationinrichmond.co.uk/

    When I try to navigate to the URL I am getting following error:

    Fatal error: Call to undefined function get_called_class() in /var/sites/t/test.accommodationinrichmond.co.uk/public_html/wp-content/themes/BookYourTravel/includes/theme_utils.php on line 860

    The error seems to be pointing at this piece of code in the theme utils.php folder:

    if ($custom_byt_paged) {

    $pager_settings['format'] = '?paged-byt= # ';
    $pager_settings['current'] = max( 1, get_query_var('paged-byt') );
    } else {
    $pager_settings['format'] = '?paged= # ';
    $pager_settings['current'] = max( 1, get_query_var('paged') );

    I don’t suppose you have any ideas what the problem is?

    Please let me know if you need any more information.

    I am wondering why the file path in the error follows public_html/wp-content as my test folder is in public_html/subfolder/test. Have I missed a trick?

    Cheers

  119. Hi

    Love this where is the next one?  I want to move it back now pls.

    ps – also, do you do dedicated hosting?

    thx

    Karen

    1. Hello Karen,

      I’m not sure what you’re referring to in your first question. We have no context on the issue here. If you can provide more detail then we can look into the matter further. For more details on dedicated server hosting, please see: Dedicated Servers.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  120. Thanks. I think I fixed the problem with the wp-load file. However, now instead of getting those errors, when I run testsite.sunrisetosunsethomeschool.com, I get a blank page. Any ideas?

     

    1. Hello Kristen,

      Try resetting your theme back to the default 2015 theme. If this works please re-install your live websites theme on your test environment.

      Best Regards,
      TJ Edens

  121. Thank you for this excellent tutorial.

    My site is sunrisetosunsethomeschool.com.

    My testsite is testsite.sunrisetosunsethomeschool.com

    I followed the instructions, but I received the following errors when I tried to view my testsite.

     


    Warning: require_once(/home/sunris26/public_html/testsite/wp-load.php) [function.require-once]: failed to open stream: No such file or directory in /home/sunris26/public_html/testsite/wp-blog-header.php on line 12

    Fatal error: require_once() [function.require]: Failed opening required ‘/home/sunris26/public_html/testsite/wp-load.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/sunris26/public_html/testsite/wp-blog-header.php on line 12

    1. Hello Kristen,

      That error is specifically saying it is looking for a file, wp-load.php and it is not able to find it. You could copy the file from your main website files.

      Best Regards,
      TJ Edens

  122. Hi Scott,

    I have search my SQL database and it cannot find the location. The only place it finds 2015redesign is in the home and site URL which I was meant to change.

    Is it nothing to do with line 90 on the wp-config.php? (I dont see why as its a direct copy with just the database details changed). 

    Line 90 in wp-config.php is this:

    require_once(ABSPATH . ‘wp-settings.php’);

    1. Hello Jesse,

      The ABSPATH variable is defined somewhere either in the database or in the files. This is where the path is coming from that the error message cannot find. You will want to find out where this is defined and ensure it grabs the proper path.

      Kindest Regards,
      Scott M

  123. Hi There,

    After having much troubles with a transfer, I have gone through your article in great detail and found it a great tutorial, however unfortunately I am still having troubles with copying my site to a subdomain. 

    I have definitely completed step 9 and completed a search and changed my home & site url.

    I am trying to duplicate www.orbinox.co.uk to www.2015redesign.orbinox.co.uk/wp-config.pho

    If I try to visit my new website I get a blank screen. If I browse directly to the wp-config bt going to https://2015redesign.orbinox.co.uk/wp-config.php

    I get the following error:

    Warning: require_once(/web/sites/_o/_r/_b/orbinox.co.uk/public/2015redesign/wp-settings.php): failed to open stream: No such file or directory in/web/sites/_o/_r/_b/orbinox.co.uk/public/2015redesign/wp-config.php on line 91

    Fatal error: require_once(): Failed opening required ‘/web/sites/_o/_r/_b/orbinox.co.uk/public/2015redesign/wp-settings.php’ (include_path=’.:/usr/local/share/pear’) in/web/sites/_o/_r/_b/orbinox.co.uk/public/2015redesign/wp-config.php on line 91

     

    I am really lost as to what to do now and have been at it for 3 days now. Any help or advice would be appreciated. 

    Thanks

    1. Hello Jesse,

      You may need to search your database to see if this path exists. You will need to replace the current path with the new one within the database.

      Kindest Regards,
      Scott M

  124. Thanks for the reply Scott.

    YIKES! This is getting a little to technical for me. I am going to try that plugin. Hopefully it will work for me. 

    Thank you so much for your post and help, I just get really scared and confused once it gets technical.

    I will report back and let you know how it goes.

    Thanks again! You are great!

    Eliz

    1. Hello Azmi,

      Can you provide us the domain of your test website so we may look into the issue?

      Best Regards,
      TJ Edens

  125. Hai,

    I just seen this video and I followed all the instructions.But the test site seems to be distorted and i cant able to login to the dashboard. please help me to run this site.

     

    Thankyou!

     

    1. Hello Eliz,

      You will need to go through your settings and database to change any hard set URLs to the new URLs. You can view our article on correcting image links in WordPress for more information on that.

      I am not sure about the tool you listed. We cannot endorse any particular tool especially if we have not tested it.

      Kindest Regards,
      Scott M

  126. Hello,

    The problem that I have with this method is that I do not know how to update and change the URL’s of the images.

    I also found that several of my plugins no longer worked because the URLs were still pointing to old directories as well.

    This did move all of my pages and posts however there were some big gaps in my site. Much of it no longer worked and I had links that were pointing to the old site.

    Can you tell me how to fix this?

    I was thinking of using this tool: https://www.backupcreator.com 

    Will this work for me?

    Thanks!

    Eliz

  127. Thank you Scottt.

    I resolved this on the support phone line. Terrific support as usual!

    Test site is up and running, learned a lot from this video and from the guys on the phone.

    Thanks!

     

    Tim

    1. Great video!! So simple and easy to follow. I was trying to do this myself but didn’t know I had to make changes in the wp-options file. Thanks man!

  128. How do I know what database is the “productin” database? I have the _test set up, but there are 5 other databeses on the list.

    _06

    _78

    _97

    _wp37

    _wp960

     

    Step 2: Click the database you are working with in the left menu.

    How do I know which one to select?

    Thanks,

     

    Tim

     

    1. Hello NASinc,

      You may want to check for css for the pathing. That may be the issue with the fonts.

      Kindest Regards,
      Scott M

    2. Hello MK,

      Does the image upload work with the site you duplicated from? Have you changed the theme since you duplicated? If so, have you tested the by resetting it to the original theme?

      Kindest Regards,
      Scott M

    3. Hello Tim,

      Look into the wp_config.php file and you will find the database information such as name, user, and password.

      Kindest Regards,
      Scott M

  129. Hi, 

    Great video! All is working perfectly on new test site except abiltiy to upload and display images. I am able to see all of the images in the media library that were on my production site prior to copying it, but when I upload new images, I only see an icon for them. In media library, if I click to edit the image, it will load the full image but once I save it is back to just the icon.

    I am wondering if it is my theme or if I missed something in the duplication process. I am using WP 4.1.1 and Customizr theme. 

     

  130. Very helpful tutorial. Followed it and was able to get a duplicate test website, up and running, in no time on a separate sub domain.

    the only problem is that I lost the customized fonts. They do appear in the original wp website but not on the duplicate.

     

    Any hints or pointers/suggestions to overcome this and make the fonts show up in the new sub domain duplicate the same way they are in the original version ?

  131. Hi,

    Excellent tutorial. I did create 2 new subdomains for 2 new websites. Everything is working fine, able to access, able to login etc etc. I have used search&replace, to replace URL’s to new locations including images, attachments etc. I have the below issues :

    1) Image links broken : Though files and folders are there as per the locations required, still image display is not happenning.

    2) Some of the plug-ins are broken/not working : Though files/folders exist for the respective plugins and there and ACTIVE.

    3) Plugin icons not displaying : Same problem like (1), though all files/folders exist.

    Can you help in this regard.

    1. Hello Rama,

      I have found a wordpress forum thread that goes over the same exact issue you are having.
      https://wordpress.org/support/topic/how-to-change-image-urls-after-wp-move

      As for the plugins I would suggest uninstalling then re-installing them.

      Best Regards,
      TJ Edens

    1. Hello Heather,

      Thank you for your question. We are happy to help, but will need some additional information.

      What DNS errors are you getting?

      Is this a new subdomain? If so, keep in mind new domains/subdomains can take up to 24 hours to update globally (propgate).

      Thank you,
      John-Paul

  132. Scott,

    If I am using a wordpress site, can I just “clone” the site to a subdomain using a program or plugin like ManageWP…and then go from there?

    Thanks!

    Don

  133. Please ignore my last comment – I have it working now. Thank you for your help Scott – editing the config file as suggested worked!

  134. Thanks Scott, but after following the steps in the link you provided I can now no longer log into my live-site wordpress dashboard, despite only altering my subdomain/subfolder test wp-config.php file 🙁

  135. This is a really useful tutorial but I have a problem: When I try to login at test.mydomain.com/wp-login.php, the login submission takes me to www.mydomain.com/wp-admin.

    I checked every www entry in the database and changed to ‘test’. Any help would be hugely appreciated.

    1. Hello Luan,

      WAMP was made so that you could emulate running a web server on a Windows server. If you are running WAMP, then you should be able to do the steps for duplicating a WordPress site. I hope that answers your question. Please let us know if you have any further questions or comments.

      Regards,
      Arnel C.

  136. Hey guys

    I followed the video closely and it was going fine until about 4:50 on the video.  I couldn’t export anything because there was nothing in the test folder.   “No tables found in database.”

    I’m using my main account url, so am wondering if this was the issue, because I noticed all the other domains had folders inside this folder in file manager .

    any suggestions?

    Thanks,

    Cara

    1. Hello Cara,

      If you received “No tables found in database.” you may have been trying to export the wrong database. The original database has at least 10 tables in it, so you should not get that error when exporting the source database.

      As for the other domain folders being under the public_html folder, this is perfectly normal structure for the cPanel, so nothing to worry about.

      Kindest Regards,
      Scott M

    1. Hello Dave,

      Reversing the process would simply be removing the testing site. Is that what you mean?

      Kindest Regards,
      Scott M

  137. Hi there,

    Thanks for the great instructions! I’m with BlueHost. I followed everything but in the end the test site turned out to be the WP default theme, not a copy of my WP theme. What did I do wrong?

    Thanks again!

    1. Hello Annie,

      Check and see if your theme is available to select from the dashboard.

      Kindest Regards,
      Scott M

  138. I created my testsite duplicate of my domain. All works fine except when I set the static home page in my theme customization settings it changes both my domain and testsite home page. Not what I want and I have not found anything online suggesting a fix for this.

    Temp URL for my domain is https://198.46.81.188/~sfxcat5/      and I am using Word Press 4.1 and the Avada Theme package.

    Does anyone have any suggestions? Thanks.

    1. Hello Stevejal,

      It sounds like your installation for the temp is in the same place as your primary domain. By default, the primary domain would use a URL (e.g. yourdomain.com), but the files all get saved into the PUBLIC_HTML folder. If you were using the temp URL, the files all go to the same location (public_html). So, if you want to separate the installations, you would need to have one of the WordPress installs set in a subfolder or a different URL. For example: https://198.46.81.188/~sfxcat5/test. At this point though,you’re referencing the installations with two different URLS, you’re using the same files. Try using a different install directory with your test install, and then you shouldn’t have the problem that you’re currently seeing.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Kindest regards,
      Arnel C.

  139. Thanks for the quick reply Jeff. Apparently the plugin folder didn’t get copied to the new test directory… Not sure how that happened, so I added the folder. But now when I add a plugin the admin section goes blank and I have to use cPanel to manually delete the plugin folder before I can access the admin section… I must have messed something up…

    Any thoughts?

    Thanks again

    1. Ensure the permissions are correct, and if it still gives you issues, try deleting all of the content from the plugins folder. This will ensure that any broken plugins are completely deactivated.

  140. Hi,

    Great tutorial, thanks!

    Everything seems to be working except when I try and install a new plugin I’m getting the following error(has happened for 3 plugins):

     

    Downloading install package from https://downloads.wordpress.org/plugin/wordpress-automatic-image-hotlink-protection.zip

    Unpacking the package…

    Installing the plugin…

    Could not create directory. /home/getnat6/public_html/staging/wp-content/plugins/wordpress-automatic-image-hotlink-protection/

    Plugin install failed.

     

    Any thoughts? Thanks!!

     

  141. Thanks for tutorial.  I tried following the exact instructions to set up a subdomain but I get the following error when I try and access the test site:

    “The server at ‘…’ can’t be found, because the DNS lookup failed.”

    What have I missed?

    1. Hello Laura,

      If you have followed the instructions on creating a subdomain properly, you should be fine. If you tried to access it just after creating the subdomain you may get the error. This is due to propagation time. After a bit of time, (I’d give it up to 4 hours) it should work for you.

      Kindest Regards,
      Scott M

  142. If only it was that easy.  Aplus doesn’t have tutorials nor do they provide cloning assistance over the phone.  I think… I need… to switch hosting companies.

    Thanks

    1. Hello YB,

      Sorry to hear about your experience. Feel free to reach out to our Sales team, and discuss if we can meet your needs.

      We would be happy to help you migrate your WordPress site to our servers.

      If you have any further questions feel free to post them below.

      Thank you,
      John-Paul

  143. Hi All,

    aplus.net is my hosting site and my control panel is not as user-friendly; also the domain name is a bunch of numbers and letters.  Does anyone know how to clone a wp site in the aplus environment?

    Thanks

    1. Hello YB,

      Thank you for contacting us today. You can still make a copy of your WordPress site without utilizing the cPanel tools.

      I found a helpful post in the Official WordPress forums, where they discuss Copying a WordPress site.

      I also found an older post specifically covering Aplusnet, but I am not sure how accurate it still is.

      Thank you,
      John-Paul

  144. Thanks for the tutorial.  Unfortunately, I have made a mess of it.  I attempted to carefully follow each step, but keep getting a ‘Server Not Found’ message (https://test.mcfarlandeye.com/).  In my attempt to go back through the steps and correct anything I may have missed, I now have created a messy file directory that I just need to delete. How can I delete and start over?  Any ideas on why I’m receiving this message?

    Thank you!

    Sara

  145. Hi John-Paul,

    Mostly I’m not getting errors, it loggs in but redirects to the test site backend. I’ve noticed too that the website pages seem to be opening as either the original site or the test site, mostly it is redirecting to the test site. I was thinking about retracing my steps and undoing the setup of the test site up to adding te database then trying again. What do you think?

    Siri

    1. Hello Siri,

      Undoing and retracing would be what I would do. There should be no effect on the main site during or after the process, so it is likely that something got changed that maybe shouldn’t have. That should reset you so you can try again. Believe me, we have to do that all the time so do not be afraid to do that when needed.

      Kindest Regards,
      Scott M

  146. Hi John-Paul,

    My site is working, I can see both the main site and the test site just fine and I can get into the backend of the test site, but I can’t seem to get in to the backend of the main site anymore. I really need to be able to get in there to add content etc to the main site, the test site I was setting up as a play and learn area so while I do want to be able to try stuff out there, I want to be able to add to the main site as well. Is there a way to switch the dashboard back to the original site dashboard? (there’s already stuff I cant access because it was posted after I copied the database over to the test site).

    Thanks for your help

    Siri

    1. Hello Siri,

      Thank you for contacting us today. We are happy to help, but will need some additional information information.

      What happens when you attempt to login to the backend of the main site?

      Are you getting any errors? What are they?

      Thank you,
      John-Paul

    1. Thanks John-Paul, I can see the site with proper styling now but I can’t seem to get into the dashboard. I tried redirecting in the general settings (after I had done the config) to see if this would work and now i can’t get in as it won’t recognise my password. o’oh :/

  147. thanks for a really good tutorial, very clear instructions. I’ve followed the instructions and the test site is there but it’s not showing the theme installed in the original site. I’m also not sure how to get in to the dashboard on the test site

    url is test.*************.com.au (original is *************.com.au)

    1. Hello SIri,

      Thank you for your question. Please make sure you have completed Step 9, which changes the domain to the new test URL.

      This should fix the styling of the site and allow it to resolve at the new test URL. For example: https://test.*************.com.au

      Then, you would login to the dashboard using the test URL, for example:
      https://test.*************.com.au/wp-admin

      Thank you,
      John-Paul

  148. Hi All,

    THanks for posting this tutorial. It is very helpful and easy to follow.

    I almost got it right however I must have meesed sth up because it does not entirely work.

     

    My original site:

    example.mydomain.eu available under www.example.pl

    My test site:

    mydomain.eu/exampletest

     

    When I enter this URL: mydomain.eu/exampletest/wp/wp-admin I can actually log into it.

    However when I want to bring it up: mydomain.eu/exampletest/wp it redirects me to the original www.example.pl

    I have now run out of options as to what I am doing wrong.

    Any help will be greatly appreciated.

     

    regards,

    Peter

    1. Peter,

      Thanks for the question. If your installation of WordPress was going to a particular path but it’s a sub-directory under another website installation, then you need to make sure that none of the applied re-direct rules are applying to your current URL. Re-direct rules are generally found in the .htaccess file. Since you have not provided us any information on your account we cannot check this for you. You can see an example of a re-direct by going to this article. Click on the link for more help on finding and editing the .htaccess file, please.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  149. Great tutorial.

    If i create my duplicate website in a subdomain, will my username and password to access wp-admin be the same as the root domain?

    I’m afraid that Google will read my test website as duplicate content. How can i prevent Google from reading my test website?

     

    Ori

    1. Hello Ori,

      Thank you for your WordPress question. Yes, your duplicate website will use the same username and password as the original. You can always change WordPress password, and username.

      You can stop Search Engines from crawling specific folders, by using a robots.txt file. For example, you could stop them from searching the folders containing your duplicate site.

      You could also password protect the folder containing the duplicate site, then it will only be accessible via username and password.

      Thank you,
      John-Paul

  150. Hi there, thanks so much for the vid. Pretty easy to follow. My website has the suffusion theme. However, when I go to the test site, a lot of the suffusion styling isn’t there – and there are some text widgets missing in the left hand column? Can you please advise?

    www.cleaningafrica.co.za and 

    www.test.cleaningafrica.co.za 

    Many thanks,

    Alison

     

    1. Depending on how your theme is coded, you may have additional hard-coded links in there which can cause issues. To check for this, you may do a full search on your database within PHPMyAdmin by clicking the Search button up top and entering in your domain.

  151. I searched for my website through my php admin and changed all the websites to the test version within the wp options of my test site. I also went into the config (codex) of my website to see line 59 (assuming that is what its refereing to) and tried removing it, still same error. I just started my website, www.vincenzocutrone.com and have limited coding and web creation knowledge. The test site is www.test.vincenzocutrone.com. I also tried de-activating Jetpack from the main site, still getting the error. Is there something else that i’m doing wrong?

     

    Thanks again for the help, I apologize for my lack of knowledge on the subject matter.

    1. Hello Vince,

      Sorry to hear you’re still having the problem with Jetpack. If you’re still seeing that error, then it’s most likely because that plugin is still loaded somewhere on that site (or at least a piece of it is). You need to remove it completely in order to clear the error. If you need more information on troubleshooting plugins, check out troubleshooting WordPress plugins. You will need to remove Jetpack from your duplicate install.

      If you are a customer of InMotion, we can also look at the files directly, but we need your account info and a little time to work on your web site. I hope this helps you to move forward. Please let us know if you have any further questions or comments.

      Regards,
      Arnel C.

  152. great tutorial, although once i’m done setting up my test site and try to log-in I receive the following error. Any ideas?

    Fatal error: Cannot redeclare jetpack_is_mobile() (previously declared in /home4/vince06/public_html/wp-content/plugins/jetpack/class.jetpack-user-agent.php:3) in /home4/vince06/public_html/test/wp-content/plugins/jetpack/class.jetpack-user-agent.php on line 59

    1. It appears that your site is attempting to load the Jetpack plugin from both your testing environment as well as your main site, on the same site. I recommend checking through your wp-config.php file as well as your database of your testing environment for any old references to your main production site.

  153. https://josh.thekoreanwave.org
    https://thekoreanwave.org/josh
    Warning: define() expects at least 2 parameters, 1 given in /home/content/10/7441410/html/josh/wp-config.php on line 28Warning: Cannot modify header information – headers already sent by (output started at /home/content/10/7441410/html/josh/wp-config.php:28) in /home/content/10/7441410/html/josh/wp-includes/functions.phpon line 2973
    Error establishing a database connection
    Please help
     
    Thanks in advance.
     
    Josh

    1. Hello Tejas,

      If you moved your site to a subfolder, for instance, from example.com to example.com/test, then the wp-admin URL for the test would be example.com/test/wp-admin.

      Kindest Regards,
      Scott M

    2. It looks like you made an error when editing your wp-config.php file on like 28. Could you provide exactly what you have on that line?

  154. Awesome tutorial. This really helped me out. Thanks!

    And Sean, I had the same issue initially. Turns out I copied all the files to the wrong test folder. It’s case sensitive, so make sure the folder is public_html/Test not public_html/test or vice versa.

    Don’t know if that was your issue, but I got hung up because of that. Best of luck!

    Jamon

  155. Unfortunately, this did not work for me.  Followed instructions carefully and appears as if everything is moved over, but when i go to the new URL (subdomain), I am told the page is unavailable or does not exist.  Thoughts?

    1. Hello Sean,

      Sorry to hear that you’re having problems with duplicating your site. It would help to be able to see your URL or account, so that we can take a look to see what you’ve done. Instead of us guessing at the problem, please provide us a little more information and we would be happy to look further into the issue for you.

      Kindest regards,
      Arnel C.

  156. Great tutorial!  So after the “test site” is complete how do you copy it back over to replace the original site?  Do I just follow essentially these same steps again?  Thanks!

    1. Hello Joey,

      I would recommend that you copy all of your WordPress files in the main /public_html directory to a new one such as /wordpress-backup. Then move all the WordPress files from the sub-directory WordPress installation into the /public_html directory.

      Once that is complete, you now have the same core WordPress files in your /public_html directory that were in your /public_html/wordpress directory. The wp-config.php file from that sub-directory installation is pointed still at the new database you crated for the copy site as well.

      You will then want to change the WordPress address directly in the database, and modify the siteurl and home rows in the wp_options table to read just your main directory instead of the sub-directory address.

      That should be all there is to it. You might also find my guide on how to easily move WordPress helpful in the future, especially the 2nd video and steps. In your case of moving from a sub-directory to the main root would get to skip the exporting and importing the database section, as well as modifying your wp-config.php file, as that’s not necessary when doing a WordPress move on the same server.

      Please let us know if you had any other questions at all.

      – Jacob

Was this article helpful? Join the conversation!