Maxweb Website Design, the Cambridge Joomla webdesign company

  • Narrow screen resolution
  • Wide screen resolution
  • Auto width resolution
  • Decrease font size
  • Default font size
  • Increase font size
  • default color
  • red color
  • green color
You are here: Home arrow Articles arrow How to move your joomla site
How to move your joomla site PDF Print E-mail

Sometimes you may need to move a Joomla installation to another host server. It could be that you are moving it from a development server on your local machine, from a demo server to the live server, or you simply want to change host. In this article I hope to explain the normal scenario.

The transfer of a Joomla site can be summarised in 3 steps:

  1. Transfer the files
  2. Transfer the database
  3. Configure on the new server

Transfer the files

This can be done by FTP. Either you can FTP every directory over (this can be slow), or you can first zip up the whole Joomla installation into a compressed file and FTP that over and then unzip that file on the new server. Problem is, FTP clients don't have any commands to unzip files, so you then need access to either a file manager utility on the host that has the ability to unzip files, or shell access. If you have shell access, you can unzip the files with the command unzip -a name-of-zip-file.

Transfer the database

Dump it!

First you need to make a dump of the original database. If you have phpMySQL, this is how you can do it: use the Export functionality. Make sure the whole database is selected for export and tick off the box that says "Add DROP TABLE..." Choose to export as a file in sql format. You will now get a file that you are going to import into the new database. If you need to use a command line utility instead, here is the command:mysqldump -u database-username -pdatabase-password database-name > dumpfile-name.sql. Thirdly, many hosts have special backup facilities for databases, and if it's available you could use that as well.

Import it

If you have access to phpMySQL on the new server, you now choose the import function in the new database. If no database exists yet you need to create it. You are importing a file in the sql format. Hopefully this should now go OK and it will tell you how many queries were executed. If you don't have phpMySQL, but have shell access, this is roughly how you can do it: You need to transfer the sql dump file over to the user's home directory. Then, using the shell access you write mysql -u database-username -pdatabase-password database-name < sql-dump-filename. Again, if the database does not exist, it needs to be created first, see MySQL documentation for how to create it. Exchange the bold words for the ones applicable in your case. If you don't have shell access either, does your new host have a facility for restoring a database from a backup file? In that case, you could use that. There is a potential problem here if the charset of the database you exported from is different from the charset of the new database. You should make sure they are the same, otherwise you could get strange characters showing.

Configure on the new server

Open up the configuration.php file. There are a few entries here that need to be changed to reflect the new environment. The following entries normally need changing:

$mosConfig_user [database user ]
$mosConfig_password [ database password ]
$mosConfig_db [ name of database ]
$mosConfig_absolute_path [ path to joomla installation from user's home directory ]
$mosConfig_live_site [ the URL of the site ]
$mosConfig_cachepath [ normally absolute path followed by /cache ]

Save the file. If you now try accessing your site on the new server it should (fingers crossed) work. If it doesn't work, here are some things to check:

  • Have you set correct username, password and database name in the configuration file?
  • Have the file and/or folder permissions changed on the new host?
  • Do you have an .htaccess file that needs changing?
 
Next >
Advertisement

Skype Us



My status