wp-config.php
wp-config.php
Last updated: September 3, 2025
public_html/
or an addon domain folder).sitefiles.zip
).backup.sql
.cpuser_
— that prefix is required when you set credentials in wp-config.php
.
public_html/
).sitefiles.zip
.sitefiles.zip
and click Extract.backup.sql
→ Go.wp-config.php
Update database credentials so WordPress connects to the new database:
/** Database settings **/
define('DB_NAME', 'cpuser_dbname');
define('DB_USER', 'cpuser_dbuser');
define('DB_PASSWORD', 'SuperStrongPasswordHere');
define('DB_HOST', 'localhost'); // Check with your host if different
$table_prefix = 'wp_'; // Match the prefix of the imported database
Open wp-config.php
in File Manager → Edit. Save when done.
If the domain didn’t change, you can usually skip this. If you moved to a different domain or a different path (e.g., from a subfolder), update the site address values.
wp-config.php
// Add temporarily, then remove after confirming in Settings → General
define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');
UPDATE wp_options
SET option_value = 'https://example.com'
WHERE option_name IN ('siteurl','home');
Adjust the table prefix if not wp_
. For deep replacements inside content and widgets, consider a serialized‑safe search/replace tool or WP‑CLI.
DB_NAME
, DB_USER
, DB_PASSWORD
, privileges, and host.error_log
in the site root.http://
assets.search-replace
) to update embedded URLs.Do I need to reinstall WordPress? No. You move the existing files and database, then update wp-config.php
.
What about email accounts? Those are separate from the website. If moving email too, recreate mailboxes on the new host and migrate mail using IMAP sync tools or your mail app.
Database host? On most cPanel shared plans it’s localhost