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 is 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 subdirectory/subdomain 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 TABLE and 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.
We assume that you have created your MySQL database and the next step is to go into your SiteGround phpMyAdmin 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 computer 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.
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 environment:
public $host = 'some.host.com';
public $user = 'some_db_user';
public $password = 'some_db_password';
public $db = 'some_db_user';
public $live_site = 'http://url.to.your.joomla.site.com';
public $log_path = '/path/to/your/joomla/root/folder/log';
public $tmp_path = '/path/to/your/joomla/root/folder/tmp';
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:
public $host = 'localhost';
public $user = 'yourSGusername_mysqluser';
public $password ='the_password_you_have_defined_during_the_mysql_username_creation';
public $db = 'yourSGusername_mysqldb';
public $live_site = 'http://your-siteground-domain.com';
public $log_path = '/home/yourSGusername/public_html/log';
public $tmp_path = '/home/yourSGusername/public_html/tmp';
You should replace yourSGusername_mysqluser with the MySQL username you have created during the database setup process mentioned above. This also applies 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.
public $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.
For more information on how to manage your Joomla!, you can visit our Joomla tutorial.
If you have problems migrating your Joomla! yourself, ask your host for assistance. SiteGround provides the best Joomla hosting and such requests are handled with ease.
You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!