Actions

Difference between revisions of "Copying a Joomla website"

From Joomla! Documentation

m (GoDaddy.com Migrations)
Line 81: Line 81:
  
 
==Special Notes==
 
==Special Notes==
 +
=== Tools ===
 +
[http://extensions.joomla.org/extensions/access-a-security/site-security/backup/1606 Akeeba] is an excellent tool to backup a site and combined with [http://www.akeebabackup.com/download/akeeba-kickstart.html Kickstart], sites can be transferred easily.
 +
 +
 
===GoDaddy.com Migrations===
 
===GoDaddy.com Migrations===
 
If using GoDaddy.com, different steps are required for import to be successful. In the Database section of the hosting control panel, find the database you wish to export and click the "edit details" icon (the little pencil). From there you will see a toolbar menu at the top with the option to Backup the database. Select that option and backup the SQL database to a _db_backups folder.  
 
If using GoDaddy.com, different steps are required for import to be successful. In the Database section of the hosting control panel, find the database you wish to export and click the "edit details" icon (the little pencil). From there you will see a toolbar menu at the top with the option to Backup the database. Select that option and backup the SQL database to a _db_backups folder.  
  
 
To import, go to the new hosting panel (if still using Go Daddy)and navigate to the new database you are importing to, following the same steps for export. This time, click on Restore in the menu and select the previously backed up database. After a few minutes, your database will be as good as before.
 
To import, go to the new hosting panel (if still using Go Daddy)and navigate to the new database you are importing to, following the same steps for export. This time, click on Restore in the menu and select the previously backed up database. After a few minutes, your database will be as good as before.
 +
 +
  
 
[[Category:Tutorials]][[Category:Installation]]
 
[[Category:Tutorials]][[Category:Installation]]

Revision as of 12:47, 28 October 2010

Copying a Joomla! website is a two-part process: you must copy the files and you must copy the database (which is where the content is stored). Copying the files and copying the database are separate operations. Which you carry out first will depend on your particular circumstances but in most cases it does not really matter. If your website is being updated frequently and you need to take your website offline while the copy takes place then you will probably want to perform the database copy last so as to minimize downtime.

Contents

Copying the files

FTP download and upload method

One method of copying the files from one Joomla! installation to another is to use standard desktop FTP software to first download all of the files comprising your Web site from their location on your Web server, then upload these files to the location of the new Joomla! installation. Depending on where you're placing the copy of your Joomla! site, the new location could be a different directory on the same Web server, or it could be a new location on a completely different Web server.

It is important to maintain the same directory structure for all of your folders and files as you move them from one location to another. Fortunately, desktop FTP software will handle this automatically as you upload and download sets of files and folders. (Your FTP software should contain Help documentation which explains FTP and how to use the FTP software interface.)

Note that after you move the files from one location to another, you may still need to edit Joomla! configuration files to get your copy of Joomla! working at the new location; you may also need to change settings for aspects of your Web server to get the copy of your Joomla! site working.

In rare instances, a file may become corrupted during an FTP transfer, where only part of the file is successfully transmitted. If you encounter strange or unexpected errors with your new Joomla! installation after you copy over the files, you may want to try re-uploading your files in case of corruption during transfer.

Copying a compressed archive file method

Copying a large number of individual files using FTP can sometimes be unreliable. If you have command-line access to the both source and destination systems then you can create a compressed archive file containing all the files on the source system, then transfer that single file to the destination system where it can be decompressed.

Creating an archive file

On Unix-style systems (eg. Linux) you can use the gzip program to create .zip files, or the tar program to create .tar.gz or .tar.bz2 files. For detailed instructions type man gzip or man tar at the command line. For example,

tar cvfz joomlabackup.tar.gz /path-to-joomla

will create a gzip-compressed archive file, called joomlabackup.tar.gz, containing all of the files in your Joomla! installation.

Important note! You need to make sure you are NOT in the folder you are trying to backup when you run the tar command or you will create an endless loop.

Extracting an archive file

Having copied the archive file to the destination system, you now need to unpack it. Use the equivalent command that you used to create the archive file. For example, to unpack the archive file created in the example above, enter

cd /path-to-joomla
tar xvfz joomlabackup.tar.gz

If the user or group IDs are not the same between the source and destination systems, then you will need to amend the ownership of the files you just extracted. For example, on an Apache system, you might need to enter the command

cd /path-to-joomla
chown -R www-group.www-user *

so that Apache has ownership of the Joomla! files.

Please ask your hosting provider for the correct group and user names, www-group and www-user, on your system.

Copying the database

There are multiple methods to copying your Joomla database and moving it to a live server environment.

MySQL command line method

Usually you run mysqldump to create a database copy:

$ mysqldump -u user -p db-name > db-name.out

Copy db-name.out file using sftp/ssh to remote MySQL server:

$ scp db-name.out user@remote.box.com:/backup

Restore database at remote server (login over ssh):

$ mysql -u user -p db-name < db-name.out

phpMyAdmin method

The phpMyAdmin tool can be used to export and import a database, providing a simple way to duplicate a copy of a database using a different name on our servers.

Exporting a copy of the database to your computer

  1. Login to the database that you want to duplicate using phpMyAdmin
  2. Click the database name on the left-hand side of the page.
  3. Select the Export tab
  4. Select the Save as file option
  5. Click Go

You'll then be prompted to save the database file on your personal computer.

Importing the copy into a new database

You'll first need to create the new, empty database on your server using the account control panel. After the new database has been created:

  1. Login to the new database using phpMyAdmin
  2. Click the database name on the left-hand side of the page
  3. Select the Import tab
  4. Click the Browse button under "File to import", then select the database file from your computer
  5. Click Go to import the database
Hint: If you see a "No database selected" error, it's probably because you forgot to first click on the database name in the left-hand column.


Special Notes

Tools

Akeeba is an excellent tool to backup a site and combined with Kickstart, sites can be transferred easily.


GoDaddy.com Migrations

If using GoDaddy.com, different steps are required for import to be successful. In the Database section of the hosting control panel, find the database you wish to export and click the "edit details" icon (the little pencil). From there you will see a toolbar menu at the top with the option to Backup the database. Select that option and backup the SQL database to a _db_backups folder.

To import, go to the new hosting panel (if still using Go Daddy)and navigate to the new database you are importing to, following the same steps for export. This time, click on Restore in the menu and select the previously backed up database. After a few minutes, your database will be as good as before.