| How to move your joomla site |
|
|
|
|
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:
Transfer the filesThis 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 commandunzip -a name-of-zip-file.
Transfer the databaseDump 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 itIf 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 writemysql -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 serverOpen 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 ] 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:
|
| Next > |
|---|