WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can I switch WP to a different database just by editing wp-config.php? (5 posts)

  1. pcmt
    Member
    Posted 7 years ago #

    I've imported my WP tables into a second database. Can I switch between the original and new databases (and back again) simply by editing DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST in wp-config.php?

  2. moshu
    Member
    Posted 7 years ago #

    Yes, you can.

  3. pcmt
    Member
    Posted 7 years ago #

    Thanks. I presume the same applies to $table_prefix, in which case, when upgrading WP, it might be a worthwhile precaution to alter the table prefixes in a backup.sql file then importing the database into parallel tables (into the same database but with the new prefix) then altering $table_prefix in wp-config.php before moving over with the upgrade.

  4. moshu
    Member
    Posted 7 years ago #

    I am not sure I can follow this over-complicated process you are describing... Don't reinvent the wheel. Just follow the upgrade instructions!

  5. pcmt
    Member
    Posted 7 years ago #

    I sure will, but on one particular installation I'm having to upgrade MySQL to version 4 before doing the WP upgrade, and I'd like to test the current WP install on MySQL version 4 beforehand.

    WP upgrades where MySQL was already version 4 have gone without a hitch.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags