How to Change Joomla Database Settings After Moving a Site

After moving Joomla, a database connection error usually means configuration.php still contains credentials from the old environment or the imported tables do not match Joomla's configured prefix. Change only the connection values that actually moved, verify the destination database first, and keep a backup of the configuration file before editing it.

Collect the destination database details

From the hosting control panel or database administrator, confirm the database host, database name, username, password, database type, and table prefix used by the imported Joomla tables. Do not assume the host is localhost; managed and clustered hosting often uses a separate hostname.

Also confirm the database user has permission to connect from the web server and has the privileges Joomla needs on the destination database.

Back up configuration.php and edit the destination copy

  1. Locate configuration.php in the Joomla site root.
  2. Download or copy it to a protected location before editing.
  3. Use a plain-text editor that preserves PHP syntax and encoding.
  4. Edit the file on the moved site, not the still-working source site.

The file contains database credentials, so never leave backup copies in a publicly downloadable web directory.

Update the database connection properties

Set Joomla's database host, username, password, and database name to the destination values. Keep the configured database driver appropriate for the database engine you actually restored. A typical configuration contains properties corresponding to $host, $user, $password, $db, and $dbprefix.

Do not paste example credentials from documentation. Use the exact values created on the destination host.

Confirm the table prefix before testing

Inspect the imported database in phpMyAdmin or another database tool. Joomla tables will have a real prefix before names such as content, users, and extensions. The $dbprefix value must match that prefix exactly, including the trailing underscore when one is present.

If credentials are valid but the prefix is wrong, Joomla may connect successfully and then report missing tables or behave as though the installation is incomplete.

Review moved filesystem paths at the same time

A server move can also invalidate $log_path and $tmp_path. These are not database settings, but fixing the database while leaving old absolute paths can cause extension installation, logging, uploads, or temporary operations to fail. Update them to valid destination directories when necessary and verify they are writable under the host's normal permission model.

Test the connection and verify the database identity

  1. Load the frontend and /administrator.
  2. If a connection error remains, recheck the host, credentials, database name, privileges, and whether the database server accepts connections from the web server.
  3. After Joomla loads, inspect recent articles, users, menus, or other known records to confirm you connected to the intended database.
  4. Check System → Maintenance → Database for schema issues appropriate to the installed Joomla version.
  5. Restore normal secure ownership and permissions on configuration.php and remove temporary copies.

Avoid changing unrelated Joomla settings until the database connection itself is known to be correct.


Need More Help with Joomla?

Still having trouble? Open a support ticket with QuantaCade Support and we'll be happy to help where we can.

Support priority is given to QuantaCade products, services, and customers. However, we're also happy to assist fellow Joomla users with general Joomla questions and troubleshooting when possible.

QuantaCade is an independent Joomla extension developer and is not official Joomla support. Some issues involving third-party extensions, hosting environments, server configurations, or other systems outside our development control may be beyond what we're able to resolve.

Open a Support Ticket