How to migrate my local Joomla installation to the Joomla installation on my hosting account
First you should know that your Joomla application (portal) consists of two components: Joomla files and Joomla database.
- The files and folders of your Joomla application contain the scripts and core application code.
- The Joomla database contains all records for your website such as your site sections, categories, articles, etc.
Let's assume that you are running your own *LAMP or *WAMP webserver or you have a web hosting account with another company. You should know the root directory where your Joomla installation resides. It is often called httpdocs, public_html or www. Those are the so-called web server root directories. So let's suppose that your Joomla application in installed under your web server root directory.
The first thing you have to do when you want to transfer your Joomla applications to your SiteGround server, is to copy the entire content of your web server root directory straight into the public_html folder of your SiteGround web hosting account. Note that if you would like the site to be available via a sub-directory/sub-domain for your primary domain name it should be uploaded to the corresponding directory under public_html.
If you are running your own server probably you have already had your Joomla site files on your hard drive. In case you are hosting your account on a remote machine, simply download your Joomla site files and directories (please mind that you should keep the directory structure intact) on your desktop PC by using your favorite FTP client. (You can find here how to backup your Joomla site.)
Once the download is finished, you should connect to your SiteGround FTP account, change your current working directory to the public_html one (this is the root/main folder for your website) and drag and drop your Joomla files and folders from your desktop PC to your public_html folder.
The next step is to create a full dump of your Joomla MySQL database. If you are running your own *WAMP or *LAMP server probably you already have the phpMyadmin tool installed. If you are using different web hosting provider, they should provide you with access to a database management tool. Here we assume that you are managing your databases with phpMyadmin as it is the most popular tool for administrating MySQL databases.
Once you are logged in to your phpMyadmin tool, backing up (exporting) your database is simple. First choose your database from the left menu. Then click the Export tab. Select all the tables, check Add DROP TABLEand Save as file. Leave all other options untouched. Finally click on Go and the database dump will be downloaded to your PC. (You can find here how to export your database.)
The next step we should take is to import your database dump to your SiteGround account.
To do that you should go to your cPanel area and create a brand new database with a name of your choice. Please mind that you can create databases only from your cPanel area. You cannot execute CREATE database; MySQL statement from the phpMyadmin tool. Once you've created your new database, please create a new database username and add it to the database you have created during the previous step. For detailed instructions on MySQL database creation you can refer to the video tutorial for creating MySQL database and user in cPanel.
We assume that you have created your MySQL database and the next step is to go into your SiteGroundphpMyadmin interface.
To restore (import) a database in phpMyAdmin, first choose the database you'll be restoring from the left menu. Then click the Import tab. You have the option of importing a .sql file. Use the “Browse” button to find it on your pc and then click “Go” at the bottom.
If you receive an error message which says access denied, you should open the database dump file you have downloaded on your desktop PC with your favorite text editor and look for lines that may contain CREATE database db_name; and/or USE db_name; mysql statements. If you find any simply delete them and try to re-import the dump. If you run into trouble our friendly technical support team is available 24/7 and ready to help you.
Here we go. The final step is to adjust the core settings which are defined in your main Joomla configuration.php file. Go to your SiteGround File Manager, change the current working directory to public_html and if you have followed the steps mentioned above correctly you should be able to easily locate configuration.php file in there. Open it for editing.
Below are the main variables you need to adjust so they can fit to your new SiteGround hosting enviroment:
$mosConfig_host = 'some.host.com';
$mosConfig_user = 'some_db_user';
$mosConfig_password = 'some_db_password';
$mosConfig_db = 'some_db_user';
$mosConfig_absolute_path = '/path/to/your/joomla/root/folder';
$mosConfig_live_site = 'http://url.to.your.joomla.site.com';
$mosConfig_cachepath = '/path/to/your/joomla/root/folder/cache';
Examples provided above are the core Joomla configuration variables you have used with your desktop/home LAMP/WAMP server or with your previous host.
In order to make your Joomla site run on your SiteGround account you should adjust them as follows:
$mosConfig_host = 'localhost';
$mosConfig_user = 'yourSGusername_mysqluser';
$mosConfig_db = 'yourSGusername_mysqldb';
$mosConfig_absolute_path = '/home/yourSGusername/public_html';
$mosConfig_live_site = 'http://your-siteground-domain.com';
$mosConfig_cachepath = '/home/yourSGusername/public_html/cache';
You should replace yourSGusername_mysqluser with the MySQL username you have created during the database setup process mentioned above. This also aplies for the password for this username and for the database name. You should also replace yourSGusername with the username you are using for your SiteGround cPanel area.
$mosConfig_live_site is also essential and you should put the domain name you are using with your SiteGround hosting account there.
If you have correctly followed the instructions mentioned above and your domain name properly points to the DNS servers of your SiteGround hosting account, you should be able to see your Joomla portal.
*WAMP HTTP Server with Windows, Apache, MySQL and PHP
*LAMP HTTP Server with Linux, Apache, MySQL and PHP
*LAMP HTTP Server with Linux, Apache, MySQL and PHP
For more information on how to manage your Joomla, you can visit our Joomla tutorial.