Wednesday, April 22, 2009

Restoring Joomla Backup to XAMPP

The idea is to be able to restore different backups in jpa format submitted by students. This would allow for evaluation of student projects without requiring the IT staff to put in a server. Each project + joomla + xampp + portable app environment could then be burned to a CD for an archival copy of the project -ready to run.

First step was to copy the kickstart.php file into the /xampp/htdocs/joomla folder and to place a backup.jpa file in the same directory. Next we open a web browser and goto:

http://localhost/joomla/kickstart.php

select the backup file and click the green START button. It tells us it has:

Read: 60642 bytes
Written: 153846 bytes
Processed: 41 files

but there is no message about click here to run the joomla installer. We had chosen the default AJAX method. Let's try the javascript alternative. Actually the problem was a loose connection.

Seems to be a lot of 'waiting for localhost'...ah we are now up to 82 files...123 files...164...205...246...287...328...451...492...533...574...ah let's take a break! 1394 files...1845...4797...ah finally! Good thing we had set the php timeout to 999. At least i was able to do some vac on the bedroom and basement.

We click on the here link and it runs the joomla installer. The database is mysql the host is localhost, the username is joomla and the database is joomla.

Congratulations! End of file reached, assuming OK

Success so delete the /xampp/htdocs/joomla/installation directory and test out the web site. It comes up perfect.

Burning to CD

The last step is to burn the entire contents of the usb stick to a cd for a read-only demo. If this works then students can use Joomla to build their web sites using XAMPP running on Linux, OSX or even Windows and burn the whole thing to a CD for handing in. We could even create an autorun file that runs the portable apps executable.

To do this use Notepad to create a file called autorun.inf containing the following lines:

[autorun]
open=StartPortableApps.exe

Save the file somewhere and when burning the CD include this file in the top level (root) of the cd. We fire up toast and make a cd of the USB stick plus the autorun.inf file. We could just place the autorun.inf on the USB stick but the latest windows os malfunction created one to run it's malware/spyware/virus so we got in the habit of deleting the autorun.inf and in fact i find the windows autorun 'feature' really annoying anyway.

Whew - had to remove i bunch of stuff from the cd project, forgot that the USB stick is 8gig. A pared down portable apps environment that had a bunch of apps installed (firefox, compozer, notepad +, analog, report writer etc) plus a bunch of mysql databases ran to 699 mb!

oops - forgot to shutdown the portable apps.exe - so some files were probably open - so we put in the CD and it runs the portable apps environment automatically. We start up XAMPP, open a web browser and goto http://localhost/joomla and of course the windows firewall blocks it - the firewall never seems to figure out that localhost is the same, if you goto localhost from a cd or the hard drive or a usb stick it treats them all differently so you end up making tons of exceptions.

The page errors - why? Ok looking at the XAMPP control panel the servers have stopped. If you try and start them up they terminate almost instantly. Ah we spot the culprit, the joomla configuration.php file was not set up for mobile operation. It has:

var $log_path = 'J:\\xampp\\htdocs\\joomla\\logs';
var $tmp_path = 'J:\\xampp\\htdocs\\joomla\\tmp';

This backup was produced from a MAMP or WAMP installation, not XAMPP. So it's a coaster. No problem, plug in the USB stick and remove the drive letters from the file and burn a new cd.

Ok the new cd goes in an portableapps runs and we start up XAMPP. Apache is running and stays running but mysql has gone down. And now so has apache. Probably they are trying to write log files?

Some further research is needed on how to run XAMPP off a CD-ROM. I found a digg to a blog post called How to run XAMPP server from CD on Windows, but their server is down.

I did find information on a program called AMPstart.exe that goes in the XAMPP folder and uses an AMPstart.ini file in the same folder that should contain:

[database]
overwrite=1
folder=


We go to http://www.ampstart.com/download.php and download ampstart.exe version: 1.2.4.6 and then look at the documentation. Ah - Ampstart is a replacement for the XAMPP control panel - it erases all files needed to start xampp and can also start the web services and open a web application automatically. Add to the .ini file:

[WEBSITE]
website=\path\to\web\app

You can also auto open firefox if it is not the default web browser with:

[WEBSITE]
ExtBrowser=\path\to\browser\executable\file

If you want to make the site seem more realistic in a demo (such as a real looking url instead of localhost) use:


[WEBSITE]
ServerName=somedomain
website=\path\to\web\app

To auto shut down the web server when the web apps ends use:


[WEBSITE]
ShutdownOnClose=1

And to set the duration for the ampstart splash screen use:

[LOGO]
duration=n_second
;default 0 (depending on loading time of web server)

Ok - this will have to be done tomorrow...

4 comments:

A. D. Addison said...

This is the best support I have had so far. You are a lifesaver

naposek said...

relly really great help....searched ng time for CLEAR instructions....and you got them....thanx a lot

Matt Payne said...

Thank you for this very useful post on joomlapack!

Anonymous said...

Thanks Man, Now I can Backup my website....
CRACK SOFTWARE | Download Free Software