How to Move Your Joomla Site to a New Domain

How to Move Your Joomla Site to a New Domain

There are cases that you may want to change the domain of your Joomla site for the sake of SEO or just personal preference. If you are in such a case, you can easily and quickly accomplish the task by editing the configuration.php file with the help of the guidance below.

Note that we are discussing how to update the domain of a Joomla site on an existing server only, and this process does not involve making a transfer between servers or hosts.

Modify the Domain in configuration.php File

In fact, changing the domain name of a Joomla site only requires a modification in the Joomla configuration file which is located in the root directory of your site. Since you will need to access the file through FTP or a file management tool, we will take BlueHost cPanel as an example.

Firstly, log into the control panel, locate File Manager in the Files section, and click on the icon.

File Manager

Now select to open the root directory of your Joomla site.

Select Directory

In the list of files and folders, scroll down to find the configuration.php file.

configuration.php File

Right click on the file and download it to your local computer. We do not suggest editing the file directly on the server out of security reason.

Download configuration.php

Make a backup copy of the file, and then open it in a text editor. Now find the following line which defines the current domain used by your Joomla site.

public $live_site = '';

Add the new domain name in the setting, and your site will be soon available with that URL. The line now should be like:

public $live_site = 'newdomain.com';

Save the file and upload it to the server.

Check and Update the Database Settings

After changing the domain, you will need to check the database settings to make sure that everything is properly configured. If there is any manual effort required, follow the steps below to make adjustments.

In cPanel, find the phpMyAdmin icon in the Databases section and click on it.

phpMyAdmin

Click on the Databases button in the top menu to expand the database list, and then select the database used by your Joomla site.

Select Database

After opening the database, click on the Export button in the top menu to export all the tables. Note that the Format should be “SQL”.

Export Database

When the SQL file is successfully downloaded to your local computer, open it with a text editor. Now you need to find all the URLs of the old domain and then replace them with the new ones manually. This will take some time because the file could include thousands of lines. The “find and replace” shortcut should help.

Replace Old URLs with the New Domain

Have a careful check on the changes. Once you make sure everything is done, save the file and import it back to your Joomla database with the use of phpMyAdmin.

Import Database

Now the database settings are updated.