• Resolved words2us

    (@words2us)


    I want to make an exact copy of my main website (which is on the root directory) onto a subdomain on the same server. I’m just not sure how to go about it.

    I know there’s information on how to move a WP site here, but there I’d like information specifically on how to copy a WP site from the root directory to a subdomain, and both of them to still function properly. The problem I’m having is that, if I understand this correctly, the WP codex article above is telling me to change things from the dashboard when that isn’t going to work for what I’m doing.

    Also, I’d like to know which files I need to copy into the folder for the subdomain and which ones I don’t.

    I’m new to WordPress and website development, though, so correct me if I’m wrong on any of the points I’ve made.

    It might also be worth mentioning that my website is running on BuddyPress too.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Can you describe what you are trying to accomplish (why do you want an exact copy)? Depending on what your goal is the solution might be either to use multisite or to have a development and production version of the website…

    Thread Starter words2us

    (@words2us)

    I want to use the copy as a test website to test major changes to php files, plugins, updates, etc. before doing it on the main website, just in case it messes things up.

    Okay.

    Some background info for you…
    There are two parts to a wordpress site – the wordpress php framework (presents the information from the database as webpages), and the database (stores all the content and settings).

    The way developers do what you are describing above is to have a production environment (the “final” version that visitors see), and the development/test environment (where you can experiment, test, and develop new features without compromising the production environment). So you need two different versions of the wordpress files and the database. Many plugins create new tables and make new entries in the database, so things will be much cleaner if you have the development and production database separated.

    The Database
    You can either create 2 separate databases, or use the same database with two different table prefixes. If you use the same database with two different table prefixes, you need to edit the file
    “wp-config.php”. Find this block of code…

    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'wp_';

    I would recommend sticking with the default for your production site, but for your development site, change it something like..
    $table_prefix = 'wpdev_';

    Here is a sort of step-wise procedure for you. I’m guessing you may have to do some research for each step, but that is how you learn (chunk by chunk).

    1) Create the subdomain on your webserver. You are probably using a hosted solution, so use the control panel interface to do this. If you don’t know how, consult the tech support of your web host or do web searches for help.
    2) Copy your production wordpress files (everything in the folder “wordpress”) to the subdomain directory.
    3) Edit the wp-config.php file that is now in the subdomain directory as I instructed above. (If you go the 2 database route then you’ll need to edit the database authentication credentials in this file accordingly and you can leave the table prefix as the default).

    Now you have a separate development and production environment.

    Thread Starter words2us

    (@words2us)

    Thank you very much for taking your time to answer my questions, Max. I’ll take a look at what you’ve said and have a go.

    Create a subdomain, copy the files from your root directory and move them to your subdomain directory, and log in.

    Thread Starter words2us

    (@words2us)

    OK, it’s all sorted now, thanks to your help. Thank you both very much. ??

    I followed everything that was mentioned in this thread, but when I log into the dashboard for my staging site, it doesn’t have the pages I copied from my production site (nor does it have the installed theme). What am I doing wrong?

    @larry – if you need help, please start your own thread — this one is marked resolved.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Making an exact copy of a WordPress website on the same server’ is closed to new replies.