Monday, August 9, 2010

Joomla 1.5 Website Server Transfer

The document here comprises of few instant tips & methods to be used as guideline to be followed while transferring a Joomla 1.5.
In case you want to shift an old existing site from old hosting server to a new server, then making a new fresh installation is not always a wisest & feasible thing. Because then again you will have to spend considerable amount of time installing & configuring all the components and modules. Moreover the content data will again have to filled up. So precisely this process may take much more time & would lead to a messy situation.

Although this process is not as difficult as it may seem to you all, however if you have less experience dealing with server related stuff, then this process has to be done very carefully. And still you have confusion or doubts with the process so it is highly recommended to escalate this task to a professional.
Illustration:
To try & make understand you the process in details we will consider & scenario of shifting a domain called 'mytestjoomla.com' to it's new hosting server.
So now presuming you are all set up for shifting your site, please find the procedure enlisted below:

Procedure 1: Data Backup:


First & foremost thing is to take backup of the data of your website of your local hard drive. Backup can be taken using shell command if you have root access of the server or by simply using any FTP client application.
Illustration:
Connect to your old site server using FTP client, and then download all the Joomla based files & folders to your local hard drive. Suppose all the Joomla files of your site are in 'myJoomla' folder of your site then download the data from 'myJoomla' folder of server to a back up folder (say myDownloadedFiles) on your local machine.
After downloading the data, I would suggest you to take backup of 'myDownloadedFiles' folder as well.

Procedure 2: Export your database:


Now the second important step is to export the database files. If PHPMyAdmin is installed in your server, then this process would be an easy step. If not then you ma ask your hosting provider to either install PHPMyAdmin or any other relevant application preferred by you. Anyways considering that PHPMyAdmin is installed in your server, then using Export database functionality of PHPMyAdmin , you will have to execute a backup process for your database file in a SQL file format. Make sure that all the data is exported properly, don't try & export tables one by one.
Illustration:
Save your database files in a folder say 'myOldDatabase' data folder of your local machine.

Procedure 3: Update configuration.php:


After completing the above task carefully, now go to the folder where the data had been downloaded. There you will find a file named 'configuration.php'. This file would be in main folder (first level folder) of the site. After finding this file, open it in your preferred editor & change the following parameters:

1) Change ABSOLUTE path.
2) Change CACHE path.
3) Change HOST.
4) Change DATABASE NAME.
5) Change DATABASE USERNAME.
6) Change DATABASE PASSWORD.

Procedure 4: Upload all of your files to your new server:


Now, Using an ftp application, upload all of your files from your local hard drive to new server location where you want to install Joomla!

Procedure 5: Import your database to your new MySQL server:


Using PHPMyAdmin and the SQL file you generated in step 2, import your old database into your new database.

And then import the previously exported SQL file (generated in Procedure 2) to your new database of new server. Again this can be done using PHPMyAdmin or through shell commands.

Procedure 6: Test your new installation:


Finally after adding up database files, our task is almost done. Now your domain provider can point your domain to your new server. And your site, will show up on the new server. However please check the entire site & it's functionality first.
I
f everything shows up well, then CONGRATULATIONS, you would be successful in this task.

Friday, March 19, 2010

Javascript Basics

What is JavaScript?

  • JavaScript was designed to add interactivity to HTML pages
  • JavaScript is a scripting language
  • A scripting language is a lightweight programming language
  • A JavaScript consists of lines of executable computer code
  • A JavaScript is usually embedded directly into HTML pages
  • JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
  • Everyone can use JavaScript without purchasing a license
  • this is a case sensitive scripting language
  • based on OOP paradigm of Programming Languages
JavaScript is used in millions of Web pages to improve the design, validate forms, detect browsers, create cookies, and much more.
Since JavaScript is currently the only scripting language supported by every major web browser (Internet Explorer, Firefox, Netscape, Safari, Opera, Camino, etc), it is very widely used. When code is rendered by your web browser, like JavaScript usually is, it is called a Client-Side script. JavaScript can also be run on a web server to generate HTML documents, thus running as a Server-Side script. "JavaScript cannot be a standalone application instead it an Internet based application embedded in a web page & executed on a JavaScript compatible browser." Javascript is capable of manipulating data as well as Events {Event: any action on browser, e.g. OnmouseClick etc.}. The script is actually just some commands that the browser has to do.

What can JavaScript do?

  • Provide Interactivity to HTML elements.
  • A JavaScript can be used to validate form data before it is submitted to a server. This saves the server from extra processing.
  • Can be used to read/write i.e change html element's data.
  • Manipulate Events.
  • Detect Browser so as to fire Browser specific code.
  • A JavaScript can be used to store and retrieve information on the visitor's computer, this can be done with the help of Javascript Cookies.
  • Provide dynamic functionality to a web site.
  • Can develop Client-Side Script oriented or Server-Side Script Oriented Internet Applications.

Toolset Required for JavaScript:

  • Javascriptcompatible Browser.
  • Any Editor e.g. Notepad, Editplus etc.

Prerequisite Knowledge Required:

Prior knowledge of HTML/XHTML is required as a prerequisite to the knowledge of Javascript.

Syntax:

First, we need to know how to add JavaScript to an HTML page. JavaScript can be added in one of two ways:
  1. You can place Script tags in your webpage and place the JavaScript code inside of those.

    <script type="text/javascript">

    ... block of code ....

    </script>
  2. You can place all of your JavaScript code in another file and link to it with a Script tag.

    <script type="text/javascript" src="scripts/YourJavaScriptFile.js"></script>
<script>...</script>: Interprets to browser that some sort of script is to be encountered.

Type=””: attribute of script element to describe which scripting language to be used.

Src=”<path of js file..>”: attribute of script element to mention source path of .js file.

Commenting Styles:

  1. <!-- code to be commented - ->
  2. // code to be commented
  3. /* code to be commented */

JavaScript Where To ...:

You can place an unlimited number of scripts in your document, so you can have scripts in both the body and the head section.

JavaScript Blocks:

JavaScript statements can be grouped together in blocks. Blocks start with a left curly bracket {, and ends with a right curly bracket }. The purpose of a block is to make the sequence of statements execute together.

JavaScript Statements:

A JavaScript statements is a command to the browser. The purpose of the command is to tell the browser what to do.
The semicolon is optional (according to the JavaScript standard), and the browser is supposed to interpret the end of the line as the end of the statement. Because of this you will often see examples without the semicolon at the end.
Note: Using semicolons makes it possible to write multiple statements on one line.

JavaScript Variables:

As with algebra, JavaScript variables are used to hold values or expressions. A variable can have a short name, like x, or a more describing name like length. A JavaScript variable can also hold a text value like in carname="Volvo".

Rules for JavaScript variable names:
* Variable names are case sensitive (y and Y are two different variables)
* Variable names must begin with a letter or the underscore character
NOTE: Because JavaScript is case-sensitive, variable names are case-sensitive.
Syntax for Declaring (Creating) JavaScript Variables
var statement;

More Details about JavaScript will be posted in my next article....