Support » Fixing WordPress » Can I switch WP to a different database just by editing wp-config.php?

  • Resolved pcmt

    (@pcmt)


    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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Yes, you can.

    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.

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

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can I switch WP to a different database just by editing wp-config.php?’ is closed to new replies.