Sometimes it is necessary to change the domain name for a website in Joomla. When you are using Joomla this will involve making a change to a configuration file and possibly your database. The following article will take you through the steps for changing your Joomla website URL.
Modifying the Domain Name for Your Joomla Website
Modify the configuration .php file of your Joomla Installation
- Login to your cPanel and then go to the File Manager.
- Locate the installation files for your Joomla files. Search for the root folder of your Joomla installation, then open the CONFIGURATION.PHP file in one of the editing options of the File Manager.
- Look for the following setting:
The “domain_name.com” represents the current setting. Below the “new_domain.com” represents your new domain name. Replace the text of the current domain name with your new domain name.
- Once you have completed the change, click on SAVE CHANGES in your editor.
Change the Database Settings of Your Joomla Installation
- Login to your cPanel.
- Scroll down to the DATABASES section and click on phpMyAdmin.
- Select your Joomla database and then click on EXPORT in the top menu after the database is selected. The exported format will be SQL (e.g. filename.sql)
- Save the resulting SQL file to your local hard drive.
- As insurance, please make a copy of the SQL file and save in another folder or location. Basically, you’re making a backup of your SQL file. You can also re-export the database and simply select a different file name, or different location.
- Open the exported SQL file that you wish to edit in a TEXT EDITOR (e.g. Notepad.)
- Find and Replace all of your old URLs with the new one. Note: the default keyboard shortcut for “find and replace” is CTRL+H (hold down your control key and click on ‘H’) – this will bring up the Find and Replace dialog.
- Once you have replaced all of the old URLs with your domain name save the SQL file.
- Next, in order to replace the old entries in your database, you will need to remove them before you can bring in the changes. In phpMyAdmin, click on the Structure tab in order to see all of your tables.
- Scroll to the bottom of your table list and then click on the box labeled Check all.
- Next, click on the drop-down arrow to the right where it is says “With selected:”. In the drop-down menu, select Drop under the section labeled Delete Data or table. It will proceed to execute dropping all of the tables, but will give you one last “Yes or No” to complete the process. Click on Yes to complete the drops. Note, we are not deleting the overall database, just the tables. Don’t worry, as you are about re-populate it with the updated table. Also, remember that you should have a backup of the database in the event that something happens to interrupt the process.
- Once all of the tables are gone, you can then go forward with importing the updated table. Go back to phpMyAdmin and then IMPORT your updated SQL file back into the SAME Joomla database.
This completes the steps necessary to change the domain name for your Joomla website. Remember that the changes for the database might not be necessary as it depends on how you configured your Joomla website. If you require further information on Joomla, please go to the Getting Started Guide: Joomla.