WordPress.org

Ready to get started?Download WordPress

Forums

Copy (clone) one of my wordpress sites to a new domain (5 posts)

  1. nnjneverland
    Member
    Posted 4 years ago #

    Hello,
    I am attempting to copy one of my wordpress domains to a new URL that i currently own and is on my server.
    Example: I have my first site, ABC.com (that talks about cars) and I want to make a new site with the same exact format, styling, etc but different text and graphic content on XYZ.com (which will talk about boats).

    What I have been doing the following steps on my server as follows:
    1) Deleting any files I have in my new domain (XYZ.com)
    2) Copying all of the files from the original domain (ABC.com) and pasting them into into the new domain's (XYZ.com) file manager

    When I go to XYZ.com, I now see ABC.com's page perfectly (which is good). However when I go to alter the new domain's (XYZ.com) contents by going to XYZ.com/wp-admin, I get redirected to ABC.com's admin page with this address in the url bar: "http://ABC.com/wp-login.php?redirect_to=http%3A%2F%2FXYZ.com%2Fwp-admin%2F"

    Could anyone tell me if (1) My first two steps are correct? (2) If so, how do I get to the correct wp-admin of the new domain in order to alter the new domain's contents?

    Thank you for your help :-)

  2. Jason_CT
    Member
    Posted 4 years ago #

    Try adding these two lines to the wp-config file to force the the correct domain

    define('WP_HOME','http://XYZ.com');

    define('WP_SITEURL','http://XYZ.com');

    You could also get into the database directly if you are familiar with phpmyadmin and modify the options table with the correct site and home URL.

    Good Luck

  3. nnjneverland
    Member
    Posted 4 years ago #

    Thank you so much Jason_CT for your response...
    Where in the wp-config file should I add those two lines?

    Also I am seeing in the wp-config file:

    /** The name of the database for WordPress */

    define('WP_CACHE', true); //Added by WP-Cache Manager
    define('DB_NAME', 'ABC');

    ...Should i change that "ABC" to the database name for XYZ?

  4. Jason_CT
    Member
    Posted 4 years ago #

    nnjneverland,
    You can add the Home and Site definition below the database connection settings. Did you update the database location, name and login info in the wp-config file of the new site? See below:

    define('DB_NAME', 'youdbname');

    /** MySQL database username */
    define('DB_USER', 'yourdbuser');

    /** MySQL database password */
    define('DB_PASSWORD', 'yourdbpass');

    /** MySQL hostname */
    define('DB_HOST', 'localhost');

    As far as WP Cache, I think you could update it here if the db name is different or just re-install that plugin possibly if all else fails.

  5. ghaskygbnd
    Member
    Posted 4 years ago #

    Just came across your post and if you want a really eady way to clone a blog with a simple 5 minute cloning procedure go to

    Clone Your WordPress Blog

    and you will be able not just to clone your blog but also back it up anytime within 5 minutes
    Simply brilliant

Topic Closed

This topic has been closed to new replies.

About this Topic