• Most of the solutions to this are 5 years old or older. Here’s my problem.

    I have a client with an existing WP installation, upgraded to 3.8. I need to build a new test site. So I’ve uploaded a second installation of WP in a folder (which I can eventually make live). But I need to hook into the existing database – there is too much content to move.

    I can’t risk the live site going down, so I’m reluctant to do any of the following solutions that I’ve read about.

    Change the database prefix (it’s currently “upg”)
    Change the current installation to MU. (I don’t think I need all of the MU features anyway.)

    Can I just change the config.php file of the new installation to point to the existing database?

    Thanks
    Charles

Viewing 5 replies - 1 through 5 (of 5 total)
  • there is too much content to move

    Why not use Tools -> Export/Import?

    There are a few ways to run a second WP site using the existing database… but it depends on what resources are available to you. For example do you have another IP/server? If not and you can only install on one server, then you are really limited.

    Generally speaking, yes installing another WP and configuring it PROPERLY, you should be able to just configure the wp-config.php to use the existing database. I dont know how the first one was installed… does installing a second WP affect the first one. If they are separate, how do you switch from the old to the new?

    FYI, I run an enterprise WP system. I have WP running on 7 different systems – 5 production, 1 test and 1 dev. For testing, I copy the production file and database data (mysqldump) and load it onto the test system. There are some tests where I just change my test system to use the production database (via wp-config.php). It is not a problem pointing multiple systems at the same database as long as they are configured to do the same thing.

    Thread Starter charles_i

    (@charles_i)

    I’ve never used Tools Export/Import – that might be the easiest way. I’m just wondering though, can you use this more than once to update content? If I were to Export and Import to the new setup for building the site, how do I add content that has been added to the site since my first Import later when the site is finished? Will it create duplicate entries?

    As far as “moving” the site to go live, I’ve used this method before and it works brilliantly!

    1. install WP to a folder (NOT a subdomain!)
    2. in Settings – General set site address to your site’s root address without the trailing slash
    – NOT the WP address URL – that’s the db link
    3. in the index.php file change the require link to include the subfolder, eg:
    require(‘./mySubFolder/wp-blog-header.php’);
    4. download index.php in WP app directory (not theme’s) and upload to root directory

    Thanks to askwpgirl .

    I suppose doing a mysqldump should work but it makes me nervous to think of the consequences if something went wrong.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I’m just wondering though, can you use this more than once to update content?

    Yes. If a post already exists, it won’t override.

    You COULD do SQL, but … well read this: https://halfelf.org/2013/breaking-up-multisite/

    it’s about going the other way, but the logic is still there and will show you why it’s a nightmare :/

    Thread Starter charles_i

    (@charles_i)

    Thanks, but that looks like a nightmare all right. Renaming tables alone is enough to strike terror in the heart of a developer. I think I’ll stick with the Export/Import XML (if it works) and for plugins and uploads I can just pull them down via FTP and upload them to the new location.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How do I run a second installation using the existing database on one domain?’ is closed to new replies.