Joomla Tutorials

Creating a Joomla Development Site

September 2, 2010 | Written by Steve Burge

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 2010-09-02 13:07
Wow cool. I didn't know about this extension but that's pretty sweet. It doesn't modify any core Joomla does it?
Reply | Reply with quote | Quote
 
 
# kenlyle 2010-09-02 13: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!
Reply | Reply with quote | Quote
 
 
# steve 2010-09-02 13: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.
Reply | Reply with quote | Quote
 
 
# george 2010-09-02 15:51
Is this Joomala! 1.6?
Reply | Reply with quote | Quote
 
 
# steve 2010-09-02 15:55
Hi George - just 1.5 for now.
Reply | Reply with quote | Quote
 
 
# Volker 2010-09-02 19: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
Reply | Reply with quote | Quote
 
 
# Christian 2010-09-02 20: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?
Reply | Reply with quote | Quote
 
 
# Steven Trullinger 2010-09-03 10: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.
Reply | Reply with quote | Quote
 
 
# John Garrett 2010-09-03 18:42
I had no idea this extension existed. Bravo. This is pretty exciting stuff.
Reply | Reply with quote | Quote
 
 
# ssnobben 2010-09-04 02: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!
Reply | Reply with quote | Quote
 
 
# Edvard Ananyan 2010-09-07 05: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.
Reply | Reply with quote | Quote
 
 
# steve 2010-09-07 07: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.
Reply | Reply with quote | Quote
 
 
# fusaro 2010-10-03 10: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/1397/1397/public_html/administrator/components/com_wcp/helper.php on line 181
What does it mean?
Reply | Reply with quote | Quote
 
 
# barrieroche 2011-02-01 04: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 ?
Reply | Reply with quote | Quote
 
 
# steve 2011-02-01 06: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/.../...
Reply | Reply with quote | Quote
 
 
# Marcel Bahnen 2011-04-19 05: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.
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-04-20 16:27
Hi Marcel,

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

Kind regards,
Nick
Reply | Reply with quote | Quote
 
 
# Edvard Ananyan 2011-04-20 16: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.
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-07-18 19:28
Ah, didn't know that. I stand corrected.

Cheers,
Nick
Reply | Reply with quote | Quote
 
 
# Musa 2011-07-18 19: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?
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-07-18 19:39
Hi Musa,

Unfortunately it's not.

Kind regards,
Nick
Reply | Reply with quote | Quote
 
 
# craigm 2011-08-12 17: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!
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-08-15 12: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.php file before moving on. (some people may confuse their ftp problem with a configuration.php 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.php 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
Reply | Reply with quote | Quote
 
 
# Erik 2011-08-31 15: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?
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-09-03 14: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
Reply | Reply with quote | Quote
 
 
# Stewart 2011-09-03 08:26
Hi is there a version available for J1.6 OR J1.7? This is a very usefull extension.
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-09-03 14:40
Hi Stewart,

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

Kind regards,
Nick
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-10-03 09: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
Reply | Reply with quote | Quote
 
 
# ajl 2011-10-03 02:24
please note on 2010-9-7

edvard posts a link to a version for 1.6
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-10-03 09: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
Reply | Reply with quote | Quote
 
 
# nicky 2011-10-06 10:52
Is there any chance of a version for 1.7? I tried to adapt it but ended up with cleaned out db lol ...
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-10-06 17: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
Reply | Reply with quote | Quote
 
 
# Bugger101 2011-10-31 22: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!
Reply | Reply with quote | Quote
 
 
# iowawebco 2011-11-01 19: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
Reply | Reply with quote | Quote
 

Add comment