Sometimes, we do not have an opportunity to install the website directly to the live server and in such case, the local hosting environment is a great solution. Moreover, it is much convenient to install your website locally, work your magic on it and only when it is nailed move it to live host. No worries about this Mission: Impossible at first glance. Even if you are not Tom Cruise, today you will learn how to do that trick without a nervous breakdown.
- First of all, backup all your files and folders from your local installation and get them out of harm’s way. Do not forget to export the database from PHPMyAdmin and save it as well.
- After that, start moving all the files and folders to your live server. Just create a .zip archive of your local website and upload it to your live server. You can use your FTP or cPanel for that. Once the upload is completed you need to uncompress this archive using cPanel FileManager Extract tool.
- Then, you need to create a new database on your live server, open it and within Import tab upload the sql file that you previously exported from your local installation.
- Last but not the least step is to adjust the Joomla configuration.php file that is located in the root of Joomla directory on your server. You need to make it match the database, website URL, logs and tmp directory paths.Open the configuration.php file and locate the following lines. You need to enter your new database details there.
public $dbtype = ‘mysql’;
public $host = ‘localhost’;
public $user = ‘database_user’;
public $password = ‘password’;
public $db = ‘database_name’;
public $dbprefix = ‘jos_’;
In the same file, locate the next line and instead of domain.com paste your new site url:
public $live_site = ‘domain.com’;
- Finally, adjust the path for logs and tmp directory.
public $log_path = ‘/home/username/domains/domain.com/public_html/joomla/logs’;
public $tmp_path = ‘/home/username/domains/domain.com/public_html/joomla/tmp’;
Great! Now not only you but other people can enjoy your attractive website!