Saturday, 28 July 2007

Uploading Joomla to your web server

After having developend and tested your website on a local server, the next big challenge is uploading the website to your web server, and updating the configuration such that you "go live". The tutorial below gives you the steps required to move your Joomla website from your local computer to a server. With a few tweaks these steps also apply to moving Joomla from one host to another.

Upload all files to your web server

The first thing you need to do is transfer the files to the web server where your live site will be hosted. To be able to do this, you will need FTP (FTP is a way of allowing easy transfer of files across the web) access to your web server. FTP access typically consists of:

  • FTP Address - typically this is something similar to ftp.yourdomain.com
  • FTP Login details - username / password to access the ftp area

This information is given to you when you apply for a hosting account with any hosting company. To access the FTP area you will need an FTP client. A free and easy to use ftp client is FileZilla. Download and install this client and then enter the information to your ftp area. These should be similar to the image below:

Image

Once you have connected to your webserver, upload all the files to the host. This is done by selecting all the Joomla files from your local hard drive and dragging them to the window which is connected to the host. This will start transfer of all your Joomla files to your hard disk.

Note: if you host has already installed Joomla for you, do not overwrite the configuration.php files. This contains very important details regarding the your Joomla host. You should keep a backup copy of this file. All other files can be overwritten, such that you have all the configuration you have done on the local installation.

Export / Import the Joomla database

Warning: the following steps about exporting / importing the joomla database are significantly technical. Please be aware of what you are doing because you may create a real mess.

The next step to tranfer the site you have created locally to the web server is the transfer of the Joomla database from your local MySQL, to the webserver database. This consists of two steps

  • Exporting your current local database
  • Importing the exported database to the MySQL database on the hosting company's server

Export the local Joomla database 

To export your current database you need to use the phpMyAdmin located on your local server and export the database. The phpMyAdmin URL differs depending on the local development server you are using. If you are using XAMPP to test and develop you website, you will find phpMyAdmin at http://localhost/phpMyAdmin

Choose the database which contains the website you want to upload, and export it to a file. This step depends very much on the phpMyAdmin you are using. However, there should be an Export link. Export all the tables. Once the database has been export to a .sql file, you should open the file with a text editor, and check that the file looks ok. It should contain the Joomla tables. Make sure there isn't a Create database line. The database should be created manually.

Import to the hosting MySQL database

Once you have exported the database, you need to import on the host. Your hosting company should be able to provide you with access to MySQL. If you still haven't created a database you should create it now. Take note of all details, especially the address of the server where the MySQL resides, the name of the database, username and password to access the database. If the Joomla database has already been created previously (using the Joomla installation procedure or otherwise) you should use the details given to you when creating the database.

Log on to the phpMyAdmin interface, find the import tab, and import the file you have exported above. Once again, the location of the Import link varies depending on the phpMyAdmin version being used, however this should be fairly intuitive.

Configure 

Up to now, if you try to access your website, you will probably be given an error. This is because the configuration.php file you had on your local server does not contain the information related to your hosting account details. As stated previously, if your host has already installed Joomla for you, you should leave the configuration.php file created unchanged. Otherwise you will need to change the following critical details:

Joomla 1.5

  • var $host = 'localhost'; - this is the address of the server which is hosting your MySQL database
  • var $user = 'sqluser'; - this is the name of the username which will be used to access the Joomla MySQL database
  • var $password = 'p@ssw0rd'; - password for MySQL database
  • var $db = 'j15stable'; - MySQL Joomla database name
  • var $log_path = '\home\logs'; - the path where any log files will be stored
  • var $tmp_path = '\home\tmp'; - the path for tmp files 

Joomla 1.0

  • $mosConfig_host = 'mysql.youhost.com' - this is the address of the server which is hosting your MySQL database
  • $mosConfig_user = 'joomla_joomla' - this is the name of the username which will be used to access the Joomla MySQL database
  • $mosConfig_password = 'password' - password for MySQL database
  • $mosConfig_db = 'joomla_joomla' - MySQL Joomla database name
  • $mosConfig_absolute_path = '/home/xxxdomain/public_html/' - this the absolute path to your Joomla installation. This differs from host to host so you will probably need to contact your host to ask for this. This used because there are a number of core files / components files which use other files. These files are imported or referenced using the exact path to the file. If this setting is not correct, you will get a File Does not exist error.
  • $mosConfig_live_site = 'http://www.your-domain.com' - this is used so that Joomla can create links links. If you want your site and links to have a www, then put http://www.your-domain.com, if you don't want a www, the put http://your-domain.com. These settings need to be supported by your host. 
  • $mosConfig_cachepath = '/home/xxxdomain/public_html/cache' - this is absolute path to the cache directory. The cache is used to increase the performance of your website. As you can see this is the same as the absolute path plus /cache (since this is the default directory where the cache files are stored.

Once all these entries in the configuration.php file have been given the correct values, Joomla should be able to access the database and code, and thus if you go to the address of your page, you should have a working Joomla website with all the customisation you have done. If not, one of the above settings is probably incorrect, or you might need to configure some settings further.

Test and secure the website

Go through all the website, to make sure that everything has been setup correctly. Since you should have uploaded the website, most of your settings should be correct. However, you might still have some minor configurations to do, so go through each page and area to test the everything is working correctly.

You should also take all the steps to secure your Joomla website.

The Easy Way Out

As you can see, the steps are fairly complicated and require quite some knowledge of various technologies. This is not something which should be attempted by someone who does not have experience or who does not understand what is going on. If you think these instructions are too difficult to follow, use a third party component which will do all the dirty work for you. A recommended tool for this is the JoomlaCloner component. This allows you to move your Joomla installation easily.

Go Live

Start marketing your website :)

If you feel that any section of this tutorial requires further details, please comment below and we will be glad to edit the article to provide more information.

Comments
Search RSS
prince  - Thank you ... i also need help   |41.210.16.xxx |2008-03-18 15:10:24
Thank you you for your tutorial. I followed it and i'm sunccessful.
Now after
uploading the site, there are changes i suppose to make. Thats adding more text
and pictures but now i could not do it. can you help me?
Thank you
Prince Edem  - Thank you ... i also need help   |41.210.16.xxx |2008-03-18 15:12:13
Thank you you for your tutorial. I followed it and i'm sunccessful.
Now after
uploading the site, there are changes i suppose to make. Thats adding more text
and pictures but now i could not do it. can you help me?
You can use my email:
princefyber@aol.com
Thank you
Henrique Correia  - thank's   |89.214.50.xxx |2008-03-23 18:37:43
Hello,
i'm very happy. The tutorial work very fine.
Obrigado.
DP Tripathi  - Screen Shot   |203.200.95.xxx |2008-04-11 13:26:46
Your tutorial for uploading the site on server is really very nice. But, it will
be great help if you put screenshot for each steps.
Joomla Lover  - hmmm simplicity....   |85.75.16.xxx |2008-04-14 21:58:27
Thanks that's nice
all usefull information together
no sreenshots needed
User  - great work, well done   |62.178.12.xxx |2008-04-22 15:22:57
i appreciate tutorials like that!
Dinesh  - about hosting   |122.164.109.xxx |2008-04-25 07:16:22
what are files that i have to copy and paste in FTP folder account
Anthony Straight  - Thank you, and nice job.   |68.5.153.xxx |2008-07-18 01:00:38
This is a very well done tutorial, and it seemed to be at just the right
technical level, and it saved me much trouble. Thank you very much for your time
and effort.
folani  - The joomla thread   |212.66.84.xxx |2008-08-02 16:01:04
The tutorial is very clear and informative, just two points:
1- the joomlaforums
thread that you are referred to does not exist anymore
2- The configuration.php
is apparently outdated. please refresh it for joomla! 1.5X
frombaliwithlove  - need update itnfo for Joomla 1   |125.164.203.xxx |2008-08-15 16:47:28
please configuration.pho for joomla! 1.5X. It's not up to dated by now
DART  - Updates   |Registered |2008-08-16 07:49:00
Articles has been refreshed with Joomla 1.5 details.
Mori  - Mixed Results   |82.154.217.xxx |2008-09-02 00:18:48
I followed it and my host's giving me an internal server error. I then tried to
install a new joomla there and it works fine. Don't know what could be causing
the error.
Cathy   |66.93.34.xxx |2008-09-15 00:22:13
Ok after I import the database from my local machine I got 2 of them now. how do
I connect the correct database without tweaking the configuration.php that
joomla already had?
DART  - Cathy   |SAdministrator |2008-09-15 05:42:27
You'll need to change the configuration.php file to point to the new database.
Another option would be to wipe the original database, and insert the data into
it. You'll need to tweak the MySQL dump file to make sure its using the correct
database though.
Cathy   |66.93.34.xxx |2008-09-15 15:43:21
Hi dart. thanks for suggestion but how do I know it is a correct database? I
have opened the dump file and looked at it but I have no idea what I am looking
at. One thing I know, I only have one site in my local machine working with one
database and they all have the jos prefixes. By the way, this blog we are on is
by what component? It looks pretty and organized.
Cathy   |66.93.34.xxx |2008-09-15 16:06:21
Thank you so much for your detailed tutorial. Do you mind if I put a link to
this tute on my site? Thanks.
DART  - Cathy   |SAdministrator |2008-09-15 17:14:49
Hi Cathy, you're more than welcome to link to the site

As for the correct
database, you'll need to open the tables (e.g. jos_content) and check whether it
contains the latest data you have.

The component we are using for this is
standard Joomla Blog layout and JoomlaComment. However, I'd advise you to look
at MyBlog and JomComment (see links to the right)
Xero  - Thx   |116.193.170.xxx |2008-10-17 14:39:06
Thank you very much for the tutorial as it is really necessary for all of those
who have developed a site on a local server and are trying to upload the site in
a live web server.
Dini  - Thanks   |61.17.230.xxx |2008-10-18 04:43:37
Thank you very much for your help. This was so helpful to me.
KimmOK  - I only get a directory tree??   |90.130.9.xxx |2009-01-11 14:20:45
I have tried to follow the instructions but I only get a directory tree when I
go to my domainame...what could I have done wrong??? Would bre gratefull for
help.
DART   |Administrator |2009-01-12 16:08:17
Trying putting in yourdomain.com/index.php
Anonymous   |81.157.148.xxx |2009-01-29 18:14:47
thanks , it was the most useful one
yufman  - Skip Link     |125.161.177.xxx |2009-02-03 06:15:16
help..me.
iam upload my joomla site, but ufter finished my site error, the
first commnet is :
Skip to content
Skip to main navigation
Skip to 1st
column
Skip to 2nd column
what must i do?
thank
iocaribegoos  - error when importing database   |190.67.128.xxx |2009-02-05 21:03:25
thanks so much for your tutorial. perhaps you can help me, when I try to import
the database into the phpMyAdmin server I receive an error msg:
#1062 -
Duplicate entry '1' for key 1

how do I fix this?
Michael Herzog  - Unsuccessful Upload!     |24.5.37.xxx |2009-02-12 03:25:00
Help - just did the big transfer - nothing is working - anyone really technical
that could give us a call - 415-924-1341.
Andrea  - website admin     |67.134.223.xxx |2009-02-12 20:01:02
I know why you got that:
Duplicate entry '1' for key 1

I just went thru the
week from hell with that. I was uploading my website to a host that had
installed Joomla (that is how that host works). They installed the sample
website. That means that the sample tables are already in there, so yours are
duplicates. The only way to solve this is to use sql to delete all the sample
tables. I admit that my son dictated all the sql, but it is something along the
lines of

delete table jos_banners;
etc.
Jean-Pierre Schnyder  - Some additional tips     |217.145.5.xxx |2009-04-01 06:08:09
Here's some additional information. After uploading my locally developped site,
the home page did show up, but the menus or links crashed. After I cleaned all
the caches (Tools / Clean cache), things were ok !

Also, when exporting the
db using PhpMyAdmin, I did check "include drop table if exist statement"
option since I had previously installed an empty joomla using the Fantastico
Deluxe tool (without installing the example data !!).
padam  - mysite     |203.175.8.xxx |2009-03-17 03:48:34
Can you all help me in uploading the joomla files to the web server..

when i
upload it is showing error in some lines..

Please help in detail so that i can
upload the joomla... i cant access through Tutorial also
Pam     |88.202.213.xxx |2009-03-19 16:46:24
hi jus followed the email and go this error

Warning:
require_once(/anand.co.uk/htdocs/anandjoomla//incl udes/version.php)
[function.require-once]: failed to open stream: No such file or directory in
/home/nas01l/a/anand.co.uk/user/htdocs/anandjoomla /includes/joomla.php on line
71

Fatal error: require_once() [function.require]: Failed opening required
'/anand.co.uk/htdocs/anandjoomla//includes/version .php'
(include_path='.:/usr/share/pear-php5') in
/home/nas01l/a/anand.co.uk/user/htdocs/anandjoomla /includes/joomla.php on line
71
can any one help tried couple of things but had no luck

thanks
MaverickBlogging  - MaverickBlogging     |98.169.122.xxx |2009-03-28 05:04:04
Thank you very much, helped to get my site up and running.
Eka Kurniawan  - Sorry, I can't finish it     |118.136.211.xxx |2009-03-31 08:17:00
I have follow your Instructions..., but after all finish..., when I write the
sites address it said :
Database Error: Unable to connect to the database:Could
not connect to MySQL
Rami  - Database Errors   |94.200.9.xxx |2009-05-28 07:54:02
Jean-Pierre Schnyder wrote:
Also, when exporting the db using PhpMyAdmin, I did check "include drop
table if exist statement" .


As Jean-Pierre, I used to get errors everytime I import MySQL database on
the host. I found the fix to that is to check "include
drop table".

I have installed and updated 10s of sites since
then, all working fine.
Anuj  - Uploading Problem in server     |122.161.89.xxx |2009-06-05 05:29:30
Hi, Facing problem upload website on server..actualy it is not going 2 b
connected to database..i made different table of contactus in joomla database
and changed in componets->contacts and done the core PHP coading
there..mysql_connect("localhost","root ","" ; and the
error is coming on this line..i m telling u my error

Warning: mysql_connect()
[function.mysql-connect]: Access denied for user 'root'@'localhost' (using
password: NO) in /home/xevoken/public_html/xEvoke/components/com_co
ntact/views/contact/tmpl/default_form.php on line 11
eroor1

Plz help me and
tell me i m going right or wrong..
Anuj  - re: Uploading Problem in server     |122.161.89.xxx |2009-06-05 06:37:06
Anuj wrote:
Hi, Facing problem upload website on server..actualy it is not going 2 b
connected to database..i made different table of contactus in joomla
database and changed in componets->contacts and done the core PHP
coading there..mysql_connect("localhost","root ","
" ; and the error is coming on this line..i m telling u my
error

Warning: mysql_connect() [function.mysql-connect]:
Access denied for user 'root'@'localhost' (using password: NO)
in /home/xevoken/public_html/xEvoke/components/com_co ntact/views/cont
act/tmpl/default_form.php on line 11
eroor1

Plz help me and tell me i m
going right  or wrong..


and running beautifully on localhost
ynitsun   |213.8.159.xxx |2009-11-01 15:42:12
i have followed the tutorial and when i open the website where i think it should
be it's blank. what can be wrong?!
thanks!
DART   |Administrator |2009-11-02 07:48:45
A lot of things. You need to check your server logs to see what is really
happening. A blank screen means an internal sever error.
ynitsun   |213.8.159.xxx |2009-11-08 16:32:48
sorry im just a beginner...
how do i check my logs?
thank you!
DART   |Administrator |2009-11-13 07:28:08
You'll need to get in touch with the hosting company and ask them.
ynitsun   |213.8.159.xxx |2009-11-12 19:14:09
i'm thinking that it might be an error in my configuration file.
it seems to
be connecting to my database because it doesnt give me a connection error, just
a blank screen.
for the variable to get to the logs i wrote it like this:
var
$log_path = 'www.ecomandsolutions.com/newwebsite/joomla/logs';
is it wrong?
will that make it open up blank?
thank you!
DART   |Administrator |2009-11-13 07:30:32
The path to the logs will probably not cause your site to fail, but I'm sure its
incorrect. You'll need to ask the hosting company again for what would be your
absolute path, or else use the following article:

http://www.dart-creations.com/joomla/joomla-tips
-and-tricks/46-finding-the-joomla-absolute-path.ht ml
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Wednesday, 23 September 2009 )