Differences Between Magento 1.x and 2.x

25.09.2016

Root Folder Structure

First let's compare root folder structure of Magento 1.x and 2.x. There are major changes applied at root level. Very first thing you will identify is that some new folders are introduced and some of them are removed.

  • media and errors folder are moved to pub folder
  • skin and js folder are moved to pub/static folder. Now it is easy to maintain static content via CDN.
  • js, css, images are again divided into pub/static/adminhtml and pub/static/frontend for backend and frontend area respectively.
  • dev folder contains various tools for developers such as migration tools and tests. shell is moved to dev folder
  • downloader, includes and pkginfo folder are no more with magento 2.
  • setup directory is for installation process
  • get.php, cron.php and index.php files are moved to pub folder.

 

folder-compare

There are 2 index.php files one in Magento root folder and another in pub folder. You can configure your server to run your application through any of this index.php file. Using pub/index.php is a good option as it will stop access of application files and it is good for security.

eav.php

Database connection settings, backend name, session save settings and cache settings are declared in app/etc/env.php

config.php

config.php has list of active and inactive modules

Theme Folder Structure

Magento 2 comes with very drastic changes on the frontend. Significant changes has been apply on theme structure for performance improvements.

As like earlier version magento 1.x base package "app/design/frontend/base/" will no more exists. Each core module in Magento 2 has new folder introduced which is called "view". This folder contains all module specific files like email template, js, layout xmls, phtml for frontend and backend.

Themes are grouped by "vendor" which we known as "package" in magento 1.x. Theme structure in Magento 2 is like "app/design/frontend/vendor_name/theme_name".

theme-structure

Core module

Magento core components are exists in magento_web_root/vendor/magento directory.

Module Folder Structure

In Magento 2 app/etc/modules folder is removed and module's declaration is moved to app/code/Vendor_name/Module_name/etc/module.xml file. Each module has its own registration.php file in its root. This file is for Magento to identify it as a module.

app/code/core, /local, /community folders are removed and module structure becomes like
[root]/app/code/[Namespace]/[Module]

  • Namespace is a name of a module's vendor
  • Module is a name assigned to a module by its vendor

Next to Controller, Model, Helper, Block, etc Magento 2 has introduced new folders which are:

  • Api
  • i18n - contains module specific translation
  • view - contains module specific layout xmls, phtml

module-structure

Magento 2 Installation

First of all verify that you have the correct prerequisites to install the Magento 2 software in your system. Make sure that your system meets the following requirements.

  • Apache 2.2 or later - I have 2.4.10
  • PHP 5.6.x or 5.5.x (PHP 5.4 is deprecated) - I have 5.6.3
  • MySQL 5.6.x - I have 5.6.21

1. Install Composer

Magento Team now use Composer to install the Magento software
In a command prompt enter any of the following commands to check if Composer is already installed:

  • composer -help
  • composer list -help

If command help displays, Composer is already installed; in that case, you can continue with Next step.
Download and run Composer-Setup.exe from https://getcomposer.org/download/. It will install the latest composer version and set up your PATH environment variable so you can simply call composer from any directory.

2. Clone the Magento repository

Download the Latest beta version of Magento 2 from https://github.com/magento/magento2/releases branch. Download the zip file and extract the zip file in your root directory and give it name "magento2".
Now open command prompt and go to magento2 root folder path and run "composer install" command.
This command updates package dependencies which will take a few minutes to complete.

composer install

Open phpMyAdmin and create new Data base for Magento 2.0 magento2

3. Magento 2 installation using setup wizard

Magento installation have very easy 7 steps.

Step 1: Agree and Setup

  • Open a Web Browser
  • Enter the following URL in the browser's address bar:
    http:// [host or IP]/[path to Magento root]/setup
  • Click Agree and Set Up Magento.

Step 2: Readiness Check

  • Click Start Readiness Check.
    If any errors display, you must resolve them before you continue.
    Click More detail if available to see more information about each check.
  • Click Next

Step 3: Add a Database

  • Enter Database Server Host
  • Enter Database Server Username
  • Enter Database Server Password
  • Enter Database Name
  • Enter Table prefix
  • Click Next

Step 4: Web Configuration

  • Enter your Store Address
  • Enter your desired magento admin Address
  • Click Next

Step 5: Configure Language, Time zone and Currency

  • Select your desired Time Zone, Currency, and Default Language
  • Click Next

Step 6: Create Admin Account

  • Enter Admin username, email and password details
  • Click Next

Step 7: Install

  • Click Install Now
  • To see installation progress or error details, click Console Log.
  • In the event of problems, click Previous to go back and fix incorrect entries.
  • Success displays to indicate a successful installation.
loading