Home arrow Blog arrow Backup your Joomla site or move to a different server
Backup your Joomla site or move to a different server
Written by Cheryl Allin   
Tuesday, 24 July 2007

Since I recently did this for a client, I thought I'd create a quick (well, maybe not so quick) and easy (ok, not so easy either) tutorial on how you can backup your Joomla site and move it to a new web host.

Since Joomla is made up mostly of files and folders with a MySQL database, we'll want to backup both.  The best way to start is to create a backup folder on your PC and then:

1. Using FTP, copy your Joomla site's configuration.php file over into your backup folder.

2. If your current host supports SSH - download a free program called Putty and login via SSH (if you don't know your login settings, check with your web host) - and we'll compact all of your Joomla files into one compressed .tar file.  First, you need to get into the root folder of your Joomla files - if your files "live" on the main directory, do nothing.  If you have them in a folder, then we need to get in there - so, if your files are in a /joomla folder off the main directory, type in:  cd joomla - the SSH prompt will then show you're in that folder.  (For more cool SSH commands, visit this site and this site .) Now, to create the backup we type in: 

tar -cpzf filename.tar.gz *

Now hit 'Enter' and Putty will create your backup file. It should be done within seconds (you'll know because the Putty prompt will pop down one line) and now you can either download this file through your regular browser by just pointing to it; i.e. http://www.yoursite.com/filename.tar.gz or 'get' it using a regular FTP program just like you would any web page, image file or script off your webserver previously. 

3. If we want to move our site, we can also use SSH to grab our backup file directly off of the old host and onto the new host.  First, you need to login to SSH on your new web host server - since you may not have a domain associated, you web host should give you an IP address to use.  You'll then want to type:

wget http://www.old_host.com/~username/filename.tar.gz

Now hit 'Enter' and Putty will grab that file and place it onto your new server!

4. We now want to use Putty to extract all of your Joomla files out of the .tar - here's what we need to type:

tar -xzf filename.tar.gz

Now, hit 'Enter' and Putty will extract those files - when you see the prompt move down, you'll know it's done!

5. To clean up, you can delete that backup off of your old server and delete that file off of your new server to save space - either via FTP or SSH. To delete a file with SSH, just type in:

rm filename.tar.gz

Hit 'Enter' and Putty will delete that file for you.

6. Now we want to backup your database - your web host should give you PhpMyAdmin access.  If you're not sure, visit your web host and ask for help.  If you're familiar with PhpMyAdmin, simply log in to your Joomla database and if necessary, select the database you want to backup from the drop down box top-left.  Once your database is loaded into PhpMyAdmin, click the 'Export' tab at the top.  A window will load - under 'Export' click 'Select All' to grab all the files, leave the other settings at default and click the 'Save as file' radio box - you can then give your backup a name in the 'File name template' field.  Click 'Go' and your database backup will be created and downloaded to your PC.  Once it is complete, you'll want to locate it on your PC and open it in Notepad or Dreamweaver - if it's big, this may take some time.  Depending on your host, PhpMyAdmin will add information into the backup file relevant to your old hosts database server.  Since we're moving it to a new host, we'll want to delete that data so we don't have any errors when we import to the new server.  It will probably look like this:

-- phpMyAdmin SQL Dump
-- version 2.8.2.4
-- http://www.phpmyadmin.net
--
-- Host: sql.yourdomain.com
-- Generation Time: Jul 24, 2007 at 02:26 PM
-- Server version: 5.0.18
-- PHP Version: 4.4.7
--
-- Database: `joomla`
--

Once you delete those lines, save your database backup.

7. We now want to import this database backup to your new web host.  Check with your host to determine how to login to PhpMyAdmin (you may need to create the new database for Joomla on the new host, if you haven't already) - login to the new host's PhpMyAdmin and select the 'Import' tab at the top.  Using the browse button, locate your database backup and select it.  Leave the default settings and hit 'Go' and your database will be imported - you'll get a notice if there are any errors or if the process is successful.

8.  Our final step is to use notepad or Dreamweaver to open and edit the configuration.php file we backed up in our first step.  We want to change the settings to match our new host:

$mosConfig_host = 'sql.newwebhost.com';
$mosConfig_user = 'username';
$mosConfig_password = 'password';
$mosConfig_db = 'joomla';
$mosConfig_dbprefix = 'jos_';
$mosConfig_absolute_path = '/home/username/yourpathtojoomla';
$mosConfig_live_site = 'http://www.yourdomain.com';
$mosConfig_cachepath = '/home/username/yourpathtojoomla/cache'; 

Save your configuration file - perhaps as configuration2.php so you can keep the old file and then upload to the new server with FTP - rename as configuration.php once it's on the server and you should be done!  Don't forget to change the DNS settings on your domain name from your old host to the new web host for this to work properly - you may need to use an IP to check until the domain change propagates throughout the internet.

I hope you find this helpful - and feel free to This e-mail address is being protected from spam bots, you need JavaScript enabled to view it if you have any questions or ideas on other helpful Joomla tips! 

Comments (3)add comment

Write comment

busy




Reddit!Del.icio.us!Facebook!Slashdot!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!Squidoo!Free social bookmarking plugins and extensions for Joomla! websites! title=
 
< Prev   Next >

Our Other Sites

Real Estate Drip Email Campaigns
Spinning the Web for Real Estate Professionals
Real Estate Technology Tips for Agents
Joomla CMS Free Tips Services Templates Tutorials Blog
Premier Real Estate Marketing Consultants
Virtual Assistant Directory Free Organization Network
Find USA Real Estate Home Listings for Sale
Virtual Assistant for Real Estate
Virtual Assistant Coaching VA Training and Virtual Assistant Free Directory
Virtual Assistant Coach - Virtual Assistant Training Internships
Real Estate Virtual Assistant - Real Estate Website Design, Search Engine Optimization Joomla Template Designer and Virtual Assistant for Agents and Realtors