WordPress.org

Ready to get started?Download WordPress

Forums

Copying or cloning my localhost site in another folder (2 posts)

  1. ALX13
    Member
    Posted 11 months ago #

    Hello.
    I'm using MAMP to develop a WordPress site in localhost before i uploaded to a public server. I have it almost ready but I would like to copy or clone all i have in another folder in my htdocs from MAMP so i can run some other tests in that copy of the site without breaking up all i have done. Plus i need a copy of the site to translate it to another language.
    So what i did is export all content from the site in xml and also make a copy of my data base.
    But now i wonder... when I set up the new site (i. e. the copy of the original) in another folder can I use a new name for the database with new table prefixes and then import the old database? Or the new database must have the same name or table prefixes as the original one?

    I sorry if I'm asking something thats very obvious for you guys but this is my first time with wordpress.

    Thank you very much.

    Alx

  2. 2ninerniner2
    Member
    Posted 11 months ago #

    - create a new folder in htdocs
    - copy the contents of the original site into this new folder
    - export the original database
    - create a new database (different name) and import the exported .sql file; keep it simple - don't worry about the prefixes :)
    - in phpMyAdmin, edit the site url and home fields with the new path (http://localhost:8888/clone1 for example)
    - edit the wp-config.php in the "clone" with the new database credentials
    - run this tool to update the paths for any urls for images, medial, serialized strings, etc.:
    http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    Repeat as required for additional independent "clones" of the original site.

Reply

You must log in to post.

About this Topic