WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Help setting up a DUPLICATE (copy) WP installation (5 posts)

  1. klynam
    Member
    Posted 8 months ago #

    I'm creating a completely new WP site for a client, and need to begin with an exact DUPLICATE of the existing site. Due to various hosting restrictions, the site is too large to use a WP backup / duplicator utility. So I'm doing this manually.

    Here's what I've done...

    1. Downloaded all the existing site files (by ftp) and the existing database (using phpMYadmin)
    2. Created a new WP installation in a new sub-directory on my host server
    3. Added my existing db user to the new db (so the new db has 2 authorized users)
    4. Dropped ALL the tables in the new WP db (using phpMYadmin)
    5. Imported the entire existing WP db into my new WP db - and verified everything was there
    6. Uploaded all the existing site files to the new WP sub-directory (by ftp)

    So... the db AND the site files (from the existing site) are now duplicated for the new WP installation. But when I visit the new sub-directory installation of WP, I hit the famous 5 minute installation screen.

    The first time that happened, I thought I was good to go so I simply (re-)entered all my previous admin information. THAT caused WP to auto generate a new table prefix and created an entirely NEW set of database tables (within the new db) hooked to that prefix - even though I already had ALL the correct db tables imported from my previous installation. And although the site did launch, it was "clean" with nothing from my previous installation. I created a 'test' post and found it in the newly created db tables, not the db tables I had imported from my existing db.

    So I deleted the ENTIRE table structure (again) and uploaded the existing db (again) and now I'm back at the 5-min install screen.

    Seems to me this should be VERY straight forward, but obviously I'm missing something critical. I thought I found the answer in my wp-config file, but all of that is (or seems to be) set correctly for the new databse, but calling the previous table prefix.

    Can someone help me find and set the right option(s) in the right file(s) to get this new WP installation hooked up to the the existing table prefixes in the new DB installation?

  2. esmi
    Forum Moderator
    Posted 8 months ago #

    Try reviewing Moving_WordPress.

  3. klynam
    Member
    Posted 8 months ago #

    Yes, I've reviewed that.

    I don't want to MOVE I want to COPY the existing site, so you're probably referring to the section labeled "If You Want Your Old Blog To Still Work." That is a HUGE mess with double/triple website and db downloads uploads and setting changes ?!?!?!

    All that procedure is doing is changing settings in the WP files and/or database tables, and THAT'S what I'm trying to find out here...???

    Apparently the 5-min install completes a few db fields and creates (a random) database table prefix. I simply want to bypass this and hard code the field so WP recognizes and uses that prefix. The prefix is specified in the wp-config file, and I have it set correctly. I also have all my db settings set to the correct sub directory installation.

    But something is still triggering the 5-min install routine...???

  4. sonic1243
    Member
    Posted 8 months ago #

    I do this all the time, basically restoring a backup to a new location .. I run a test site for every public site; so I always have duplicates running. The only things which need to change are the root directory location. Here's my routine:

    1/ Create new empty directory wherever you want the duplicate site.
    2/ Upload all the site files via FTP, the entire site.
    3/ Make a new database and user, import the SQL into the new db.
    4/ Edit the wp_options table: change the 'siteurl' on page 1, change the 'home' page on page 2, also 'upload_path'.
    5/ Login to admin (should not get the 5min install) and go to Settings/Permalinks; hit SaveChanges a few times.

    So, do not install a new WP installation first, simply copy your entire backup to the new location. I've done this many times now and all works as intended. Hope this helps . . ..

  5. klynam
    Member
    Posted 8 months ago #

    Thanks sonic1243 - I can see where you're simple routine would work perfectly and I was clearly "overthinking" this whole thing.

    In the meantime (probably while you were writing your post - lol) here's what I did...

    I completed the 5-min installation (again) installed a security plugin to change the database table prefix. Unfortunately, that doesn't allow you to specify WHICH db prefix is used, it simply CHANGES the existing db prefix to something else. So ultimately that did not help me at all.

    However, at that point I noticed the wp-config file had been updated with the NEW (randomized) table prefix created by the security plug. So I tried simply changing the db prefix in the wp-config file (again) and batta-bing my duplicate site came up!

    I have no idea what was locking the new WP instance into the 5-minute installation page, and I sure thought I had tried all this once before, but whatever - it worked this time.

    Thanks again sonic1243 I will bookmark this page - shalom \/_

Reply

You must log in to post.

About this Topic