Joomla Tutorials and Blog Posts

Creating a Joomla Development Site

This tutorial will show you how to create a development site in Joomla. You can make changes to your test site and then, when you've tested and are happy with them, automatically push out those changes to your live site. This is professional development behavior, because it reduces the potential for mistakes and allows you eliminate most errors before they become public.

To create a development site we're going to use an extension called Working Copy.

Install Two Joomla Sites

tutuploadsmedia_1283445482694.png

In order to synchronize a Joomla live site and a Joomla development site, you first need to make sure you have both of them. So, I've installed a live site and then a development site inside it, in a folder called /child/. You can use other arrangements, but this is a simple way to get started.

Note: Please make sure that you keep your development site private from visitors and from search engines. That means at least password-protecting the folder.

Getting Working Copy Set Up

tutuploadsmedia_1283440999825.png

We need to install Working Copy on both of our Joomla websites. When we've done that, login in to one of them and go to Components >> Working Copy >> New.

tutuploadsmedia_1283442606589.png

There are three pieces of information you need to enter in this area:

1) Choose a name for this entry and enter the path to the child website.
2) Enter the database information for the child site. If you don't know it, you can find this in the site's configuration.php
3) Enter the database information for the main live site.

That's all you need to do here. There other, more advanced settings, but that's enough to test Working Copy and get it working.

However, don't forget to enter this exact same data into both your live site and your child site.

Make a Change To Your Child Site

tutuploadsmedia_1283444707036.png

Now let's make a change on our child site - it doesn't need to be large. In fact, to test Working Copy, I recommend making only a minor alteration. In this case I modified the name of one article. I then went to the front of the site to check that the change was complete.

Seeing the Changes in Working Copy

tutuploadsmedia_1283443770945.png

Now in your child site, go to Components >> Working Copy >> Differences and you'll see a list of the things that have changed. In this case it will an update to the jos_content table (when I edited my article) and an update to the jos_banner table (when I visited the site and saw the advertising banners).

Applying Changes to the Live Site

tutuploadsmedia_1283444044496.png

Select the changes you'd like to see made on your live site and click "Commit". You should see a blue "Commit completed" message.

Check Your Changes

tutuploadsmedia_1283444979433.png

Go to your live site and check to see whether the change has been made.

Changing Files

tutuploadsmedia_1283445775514.png

OK, OK, you might say. That was fairly simple. We were able to move some database tables over. Well, let's have a look at how can we also move over file updates.

For, this example I've uploaded a module from Rockettheme to my child site, but any extension will do. You can see that 2-15 are file changes and 16-17 are module updates.

Check the Changes

tutuploadsmedia_1283446080416.png

Now, go over to your live site and look for the new extension. It should have been successfully transferred.

Commit the Changes

tutuploadsmedia_1283445957394.png

Now select those changes, click "Commit" and you should get a message saying that you've successfully moved the test changes to your live site.

Webinar by the Creator of Working Copy

Comments

 
rblalock
#1 rblalock 2010-09-02 18:07

Wow cool. I didn't know about this extension but that's pretty sweet. It doesn't modify any core Joomla does it?
 
 
kenlyle
#2 kenlyle 2010-09-02 18:14

Steve, where you mention very early, having a site inside a site, that could confuse people. You could probably omit that, because WC creates the folder automatically.

This extension seems key to developer productivity, and differentiating Joomla from other CMS. I hope that the Community can pick it up, mod it for 1.6, etc.

Great work, Steve!
 
 
kl6H_steve
#3 kl6H_steve 2010-09-02 18:38

Hi Rick - no, no core hacks.

Thanks Ken - I didn't pick that up, it's a nice feature. There's a lot more in Working Copy that I didn't cover here ... enough for several more tutorials and certainly it's worth reviving for 1.6.
 
 
george
#4 george 2010-09-02 20:51

Is this Joomala! 1.6?
 
 
kl6H_steve
#5 kl6H_steve 2010-09-02 20:55

Hi George - just 1.5 for now.
 
 
Volker
#6 Volker 2010-09-03 00:56

This is a great way to make sure your changes are accurate before you go into production with your latest update. Thanks for letting us know. Cheers, Volker
 
 
Christian
#7 Christian 2010-09-03 01:36

Thanks for the tutorial! Pretty neat!

Is it possible to add a section on how to setup the child site to be exactly the same as the live site so that we can have the current foundation to work on?
 
 
Steven Trullinger
#8 Steven Trullinger 2010-09-03 15:08

Given this was a GSoC and a joomla project , why is it not in the JED? Besides that, this looks great. I will testing and installing on all my sites.
 
 
John Garrett
#9 John Garrett 2010-09-03 23:42

I had no idea this extension existed. Bravo. This is pretty exciting stuff.
 
 
ssnobben
#10 ssnobben 2010-09-04 07:16

Thanks Steve.

Edvard is a very skilled guy and hope he update WC about the time out problems people have reported. Otherwise a 5 star comp and sure would be nice to have in a new J 1.6+ framework!
 
 
Edvard Ananyan
#11 Edvard Ananyan 2010-09-07 10:44

Thanks Steve for highlighting this! Thanks all for your kind words!

It's listed in the JED, but it was temporarily unpublished due to some changes in the JED TOS, but now it's published again.

Version for J! 1.6 can be found here: code.google.com/.../1.6

I haven't tested it deeply, but seems it works.

Currently PHP timeout is an issue on the most of hosting servers if the PHP safe mode is on. But I plan to use ajax technologies to separate big php tasks into small ones and fire them with javascript step-by-step.
 
 
kl6H_steve
#12 kl6H_steve 2010-09-07 12:04

Hi Edvard - wonderful! That's great news that Working Copy is still under development.

As you can see from the comments here, it's really useful for a lot of people.
 
 
fusaro
#13 fusaro 2010-10-03 15:05

I did exactly the entire tutorial and when I click save to create my copy, i get a fatal error saying:
Fatal error: Call to undefined function json_encode() in /home/2/1/5/139 7/1397/public_h tml/administrat or/components/c om_wcp/helper.p hp on line 181
What does it mean?
 
 
barrieroche
#14 barrieroche 2011-02-01 09:38

Steve... great tutorial... killer question is what to do if you already have a live site and want to put in a proper landscape.. create development site and then delete live ? and then create new clone for live ?
 
 
kl6H_steve
#15 kl6H_steve 2011-02-01 11:27

Hi John

Two ways to do that. If your moving a site on the same server: ostraining.com/.../...

If you're moving it between servers:
ostraining.com/.../...
 
 
Marcel Bahnen
#16 Marcel Bahnen 2011-04-19 10:13

Hi there...
very basic question: do i need 2 db and db users? For each each site one or just one for both?

Sorry if it's noobish but just starting.

cheers.

Marcel.
 
 
Nick
#17 Nick 2011-04-20 21:27

Hi Marcel,

Yes, you need 2 db and preferably 2db users as well :)

Kind regards,
Nick
 
 
Edvard Ananyan
#18 Edvard Ananyan 2011-04-20 21:32

Not really, one database with one user is enough. You will need to change the table prefix for your child site and that's enough.
 
 
Musa
#19 Musa 2011-07-19 00:01

Hello.

I've made a clone of the main site on another hosting company, but when I try running working copy it errors. Is it possible to run working copy when the main site and child site are on different servers?
 
 
Nick
#20 Nick 2011-07-19 00:28

Ah, didn't know that. I stand corrected.

Cheers,
Nick
 
 
Nick
#21 Nick 2011-07-19 00:39

Hi Musa,

Unfortunately it's not.

Kind regards,
Nick
 
 
craigm
#22 craigm 2011-08-12 22:39

We get JFTP errors when trying to copy images, checked permissions and the config file are there any common errors that we may have missed to check for. We have tried this on a clean install and an existing site and they both produce the same result. JFTP::store bad response.... help!
 
 
Nick
#23 Nick 2011-08-15 17:27

Hi and welcome, Craig!

As the error indicates, you have an FTP issue (most likely username and password).

You can either turn off FTP from your global configuration or you can try the following debug procedure:

(1) ensure you have a valid ftp account ID and password. the ftp account should be valid for your Joomla root folder, such as public_html.
(2) use a 3rd part ftp client, like filezilla, to verify your ftp account ID, password, ftp IP, port number, and your access to the Joomla root folder. If you fail this step, you need to fix it to make sure you have correct data to add to your global configuration in the later steps.
(3) once you have verify the data you have, you can log in as an administrator to your Joomla back-end and go to your global configuration> server.
(4) add all of your account data in step (2) above but keep the "enable ftp" to "no". Click "apply". If you have an error, you need to fix your access permission to configuration.p hp file before moving on. (some people may confuse their ftp problem with a configuration.p hp problem, when they enable ftp and get an error, because, if you enable ftp, Joomla not only saves your settings but also tests your ftp connection.)
(5) if you pass step (4), it means that you have the correct permission to update your configuration.p hp and your ftp account values should be added to the file. Then, you can switch "enable ftp" from "no" to "yes".
(6) if you see "FTP::login" error, your ftp account data are bad. Go back to step (2)
(7) if you pass step (6) with no "FTP::login" error but have "FTP::write" error, then your remaining problem is your "ftp root". make sure the "ftp root" value is a "local" path, not the full path of your web site. for example, you should put "/public_html", even though the full path is "/home//public_ html". if you have the correct path value and pass the steps above, you should have no more error.
(8) to test your ftp settings, go to media manager and try to upload a file and you should have no problem. and, you complete your ftp setting.

Hope this helps!

Kind regards,
Nick
 
 
Erik
#24 Erik 2011-08-31 20:32

Hi, nice tutorial!

One (basic9 question: What is the best way to install the child site.

I have a web site which I've worked on for a while, can I just copy everything into a child folder or do I need to make a backup with Akeeba and then run Kickstart to set it up or is there a simpler way?
 
 
Stewart
#25 Stewart 2011-09-03 13:26

Hi is there a version available for J1.6 OR J1.7? This is a very usefull extension.
 
 
Nick
#26 Nick 2011-09-03 19:39

Hi and welcome, Erik!

Sorry for the delay. It's hard for us to monitor support requests in the comments of blog posts, so if you're a student at OSTraining please use the support forum where we answer all questions within a business day.

As to your question, yes, you can just copy everything into a child folder, while changing the database settings in working copy as shown in the tutorial.

Kind regards,
Nick
 
 
Nick
#27 Nick 2011-09-03 19:40

Hi Stewart,

Unfortunately, there isn't. It's currently only available for 1.5.

Kind regards,
Nick
 
 
ajl
#28 ajl 2011-10-03 07:24

please note on 2010-9-7

edvard posts a link to a version for 1.6
 
 
Nick
#29 Nick 2011-10-03 14:04

Hi ajl,

Nice! I forgot about that! Here's the direct link to the 1.6 version:
code.google.com/.../1.6

Kind regards,
Nick
 
 
Nick
#30 Nick 2011-10-03 14:05

Hi Stewart,

I've been corrected. Here's the direct link to the 1.6 version:
code.google.com/.../1.6

I'm not aware of a 1.7 version, however hopefully the 1.6 version will work on a 1.7 site as well.

Kind regards,
Nick
 
 
nicky
#31 nicky 2011-10-06 15:52

Is there any chance of a version for 1.7? I tried to adapt it but ended up with cleaned out db lol ...
 
 
Nick
#32 Nick 2011-10-06 22:04

Hi Nicky,

Hopefully you had a backup created :)

Unfortunately, not that I know of. You should try contacting the developer to double check with him.

Kind regards,
Nick
 
 
Bugger101
#33 Bugger101 2011-11-01 03:36

I love OSTRAININGGGGGG GG! It's like a little goldmine of uber useful stuff that allows you to keep the hair on your head!
 
 
Nick
#34 Nick 2011-11-02 00:47

Thanks Bugger101! We're glad to have you as a student as well and it's students like you that make it fun to teach! :)

Kind regards,
Nick
 
 
RonK
#35 RonK 2012-06-14 13:52

I am still on Joomla 1.5 and tought to give this a try...but even when I say aply to create a new child nor the child is created or files are copied or the database is created. Anyone a idea?

Thanks
 
 
Christian Sweningsen
#36 Christian Sweningsen 2012-10-17 01:23

Great, great idea and work. But, two years later and nothing has changed. :-(
 
 
Guest
#37 Guest 2012-10-18 15:50

This appears to be exactly what I need, but has not been upgraded to work with 2.5. Does anyone recommend an alternative? I'm not seeing anything in the Extension Library that covers the same featureset
THANKS in advance!
 

Add comment


Security code
Refresh

blog-ad

Start Online Training

Members get access to all our video training. That's 1,142 training sessions in Joomla, Drupal, WordPress and Coding.

Latest Comments

The License for Our Tutorials

All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:

  • You can re-use these tutorials.
  • You can modify these tutorials.
  • You must link back to our original tutorial.
  • You can't use these tutorials commercially.

Click here to read the full license.

Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.

Copyright 2013 Open Source Training, LLC. All rights reserved.