Home Conticreative Blogs The Joomla Blog Create a clone or "staging" site for your Joomla website

Blogs - The Conticreative Joomla Blog

Create a clone or "staging" site for your Joomla website

Attention: open in a new window. PDFPrintE-mail

Written by Marco Conti Thursday, 10 September 2009 13:01

Share |
User Rating: / 7
PoorBest 

Over the many years I have been working with Joomla! I have found that creating a "clone" (or more than one sometimes) of the main web site I am working on is a very useful tool in a Joomla developer bag of tricks. If you are using Cpanel as your main hosting control panel, this process is very fast and easy to implement.

A "staging" are on the server is very useful not only for you, the developer, but often clients will find it very handy for training and experimentation. The major advantage for them is that no matter their level, they won't screw up the main site no matter what they do.

Banner

Here is how it is done:

  1. Go to Cpanel and open the file manager
  2. Go to public_html and create a new folder called "staging" or whatever you want.
  3. Select all the Joomla files and folders (making sure not to select any folders files that do not belong, such a cgi-bin or similar ) refer to a clean install of Joomla to recognize the files/folders)
  4. Click on "Copy" in the toolbar above and choose the public_html/staging folder as the destination. Now the files will be copied to the staging folder
  5. Next go and create a new database in the Cpanel DB manager
  6. Assign the DB to the same user as the main site and give it the same privileges
  7. Go to PhpMyAdmin (PMA) and select the DB of the main site.
  8. Click on export
  9. Save the exported DB to disk (choose gzip compression)
  10. Now switch in PMA and choose the new DB. It will be empty.
  11. In PMA click on "Import" and choose the same DB you just saved to disk. Upload it.
  12. Now go to the file manager again. Navigate to the staging folder.
  13. Select "configuration.php" and click on the "edit" icon
  14. In configuration.php you have to change these lines:
    • var $log_path = '/account/public_html/logs';
    • var $tmp_path = '/account/public_html/tmp';
    • var $db = 'dbname';
    • var $password = 'password';(* Only if you changed the user as well)
    • var $user = 'username';(* see above)
    • var $ftp_root = ' ';

Now save and close.

The staging site should be working in its own folder independently of the main website, bit all user accounts and everything else should be identical to the main site.

NOTES:

If you are using Virtuemart or some other add-on scripts, they often have their own configuration file. In that case you have to make sure that you change that config file "path" as well. For instance, in Virtuemart, under "Configuration ==> Site there is a URL for both regular and HTTPS connections. That will remain with the old URL and you need to change it by adding /staging/ at the end. That's not always possible and you may have to do it in the file itself:

administrator/components/com_virtuemart/virtuemart.cfg.php

Remember the trailing slash or all sorts of funky things will happen.

As a last note, I often like to change the logo and the name of the site to make it easier not to confuse the two.

That's it. Now you have a clone of the main site for fun and pleasure.

Hope you enjoyed this tutorial.

CC.

Website Magazine

Trackback(0)

TrackBack URI for this entry

Comments (2)

Subscribe to this comment's feed

Show/hide comments
thanks
thanks, having a stage for fun and experiments is quite useful, I'll try.
Matt Janson , March 26, 2010 | url
...
A real quick question, how do you configure the stage ("clone") site to publish to live when it's all set to go?smilies/smiley.gif
cahura , January 23, 2010

Write comment

smaller | bigger

busy

10 Minute Joomla! Tips Blog

Conticreative joomla book reviews

Independent joomla hosting reviews

Joomla Training

Conticreative offers Individual and Corporate training (in person or online) on Joomla, Wordpress, Zen Cart and other leading Open Source scripts.

[Read More...]

Books

Books we suggest...

 

Spreadfirefox Affiliate Button
switch the positions on