A few days ago I covered how to clone a Joomla website so you can work on it without disturbing your users on the live site. In this followup I will give you some pointers on proper procedures while developing on the cloned site and show you how to move those changes back over to your live site.

I made some key assumptions in the first post on cloning a site for development. Be sure to check that out first before you proceed with the following guide. Also, always, always, ALWAYS back up the live site one more time before you do anything.

Depending on how your website is being used and how long you anticipate to be working on the cloned site, you will take vastly different approaches right from the beginning. This is extremely important because you will lose all benefits of the cloned development site method if you mess up here! Follow these few quick pointers for both cases, then check out your specific case for detailed info.

  • Make sure you are on the correct site - since your clone and live site are so similar, make sure you are on the correct site during administration, FTP activities, or front-end editing and reviewing of changes. Look for that "dev" in the url.
  • Be very strict with access to the dev site - user accounts will still work on the clone, so be careful who you tell about it. You don't want admins or users going and changing things without your knowledge.
  • Backup, backup, backup. Just do it. 99% of the time you won't need it. 1% of the time it will save your life.

Case 1: The live site is not being updated during development on the cloned site

What this means is that you have a site that is not getting any content additions, user comments, user accounts, newsletters, or any other changes while you are under development. This is usually the case for smaller websites, portfolio sites, and company websites.

If you anticipate anything at all to change on your live site while under development, skip to the next case!

If you are confident that your live site is not going to change during development, you can follow these steps, and you are done!

  1. Proceed with changes on the development site. Feel free to install extensions, add articles, add menu items, change templates, all to your heart's content.
  2. When you are done, open up your cPanel file manager and navigate to the root directory of your development site (we called it "dev").
  3. Select the checkbox next to every folder and file in the dev folder (or hit the select all icon)
  4. Click the move icon. You'll see a dialogue box asking where you want to move your files to. Simply delete the "/dev" part, which will set "/public_html" as the target directory.
  5. Click "move files" to start the move. This will overwrite all of the Joomla files in the root folder, which is exactly what you want it to do. It's not a big deal if something goes wrong because you backed up again first, right?
  6. Check out your live site, it should be the new one now. Your clone will now be in the root folder working off the new database. You're done.

Case 2: The live site will be changed during development of the cloned site

This is the most common case for sites that allow user registration and commenting, have writers posting new content regularly, or have admins that make little tweaks here and there continuously. The workflow is a little more difficult but will still save time and cause minimal disturbance to users on the live site.

When you start work on the dev site, you must record every single little thing that you did. Create a checklist that you can refer to later. This includes installing extensions, creating menus and menu items, listing file changes, etc. Here is an example:

  • Installed new template
  • Configured by setting style 3, setting template as default, choosing CSS menu option.
  • Created new menu called "left menu"
  • Create menu items: blogs (goes to blog extension homepage), my blogs (goes to "my blogs" page), "new blog" (goes to "new blog" page)
  • Changed bottom of newtemplate/css/template.css (see commented changes)
  • Then deleted the template and installed a new one
  • etc...
Then, after you are done with the work, you will need to copy the changes to the live site. This is not as easy as the first case because you have a difference in database structure and file structure between the live and dev sites. If you are a wiz with databases you could use a database tool to directly copy over the changes. For most people, it is easier to just do the exact same thing you did to the dev site, working off of your list. However, you will be able to do it much much quicker, pick a downtime to do the maintenance, and let your users know to expect some changes for an hour or so. Here's how to do it:
  1. Compile your list, remove items you ended up not using, and be sure you have access to all of the extensions you need to install.
  2. Take your live site offline through the global configuration or add a note on the homepage that you will be updating the site for a few minutes.
  3. Do all of the database actions you did in development first. This includes installations, adding menu items, etc.
  4. Copy over the files from the dev site that you changed. You can either do this within each file by only copying the individual lines you changed, or copy over the entire file you changed (for example template.css).
  5. Once you have done everything on your list, you should be good to go. Take your site back online or remove the update message.

Doctor's Orders

If you follow these procedures when working on a development site you will be able to easily move the changes back to the live site with a minumum amount of disturbance for your users. You will be able to test out changes, add new features, and continuously improve your web presence.

Jesse DundonJesse Dundon is a founding partner at Hathway Tech, where he is responsible for project management, training, and overall business strategy. He is a graduate of Cal Poly San Luis Obispo, avid rugby player, and a true scholar of Joomla! and web development in general.


Like this? Tweet it to your followers!

Latest articles from Jesse Dundon

Latest 'tweets' from JomDoc.com

  • Do you use SEF URLs with your Joomla site? Check out this very important post on how do save time in the long run: http://bit.ly/6nvSfv Link Wednesday, 25 November 2009 21:23
  • New Blog: Selecting a Professional Joomla Theme http://tinyurl.com/ykokson Link Monday, 16 November 2009 23:58
  • Cloning a Joomla site for development - not that hard. See the tutorial on JomDoc.com: http://tinyurl.com/yfdzzqh Link Sunday, 15 November 2009 19:28
  • Virtuemart + authorize.net customer information manager = secure customer data storage Link Monday, 09 November 2009 21:02
  • Looking forward to some improvements on the company site. Link Saturday, 07 November 2009 23:17
blog comments powered by Disqus

Getting by with a little help from our friends...

The Doctor recommends jReviews for slick design customization and extended content functionality.