Migrate Magento 1 to Magento 2 With Zero Downtime

Migrate Magento 1 to Magento 2
Last updated Dec 4, 2020

Talk to our experts if you’re still on Magento 1, there should be no more procrastination. Magento has officially announced its support for Magento 1 is going to end in June 2020. Here’s a step-by-step guide to migrate Magento 1 to Magento 2 with minimum or no downtime.

Graph showing way more number of Magento 1 users vs Magento 2

Why should you migrate to Magento 2 right away?

There are still 420,000 sites on Magento 1 even after the release of Magento 2. Few reasons you need to migrate to Magento 2 right away are:

  1. No Scope of Innovation in Magento 1: Even though the support is until next year, there won’t be any improvements or innovation.
  2. Faster Page Load: Magento 2 has architectural improvement which has made it 2x faster than Magento 1. The latest version of Magento is the future.
  3. Better Features: Magento 2 is a world-class eCommerce system. It provides better visibility into business growth, improved site performance, and omnichannel commerce experience.

When it comes to Magento 1 vs Magento 2, M2 is always a step ahead. In fact, once the support is over, your M1 website entirely depends on you.

Migrate Magento 1 to Magento 2: Step-by-Step

Before migrating to Magento 2, here are a few aspects to consider:

Prerequisites

I. Analyze your website

See which website is theme, code, extensions are compatible with the latest Magento version.

II. Take backups

As a best practice, take the full backup of your Magento 1 store – required database, folders, and files.

III. Copy Magento 1 store

Don’t use your live store for the migration process. Migrate the data from the cloned database of the Magento 1 store to achieve minimum to zero downtime.

IV. Hardware & Software requirements

If you have PHP 5, Magento 2 will not perform efficiently. To get the most out of M2, install the following:

A. Software:
  • PHP: 7.0.13 or 7.1.x
  • PHP Extensions: bc-math, iconv, json, zip, libxml, ctype, curl, dom, intl, gd, hash, openssl, mbstring, mcrypt, PDO/MySQL, SimpleXML, spl, soap.
  • MySQL: 5.6, 5.7 or Percona 5.7 or MariaDB 10.0, 10.1, 10.2.
B. Hardware:
  • RAM: Minimum 2GB
  • Drive: 24GB SSD

Solid State Drives (SSD) will cause M2 to run much faster.

Step 1: Install Magento 2

Download the latest Magento 2 version from here. Steps to follow after this:

  • Install it on a basic VPS.
  • Match the above-mentioned configuration requirements. Using NGINX with M2 is easy since it comes with a premade configuration file – nginx.conf.sample.
  • Start the installation process by performing the readiness check.
  • “Install Now” button to begin and you’re done.

Note: The installation may show up problems if you don’t have the required configuration or PHP extensions.

Step 2: Install & Run Data Migration Tool

We will migrate Magento 1 to Magento 2 using the Data Migration Tool. You can install the DMT either from Magento repository or GitHub.

2.1. Install from repo.magento.com

2.1.1. Update composer.json in Magento root installation directory

2.1.2. Log into your Magento server or use the Magento file system owner

2.1.3. Change to Magento 2 root directory

2.1.4. Enter this command:

Composer config repositories.magento composer https://repo.magento.com
Composer require magento/data-migration-tool:<version>

Note:

  • Match the <version> of the Magento 2 codebase.
  • When asked, enter your authentication keys, where your private key is your password and the public key is your username.
Option of Access keys for migrating

2.2. Install from GitHub

If you’ve downloaded Magento 2 from the GitHub repository, follow this command:

composer config repositories.data-migration-tool git
https://github.com/magento/data-migration-tool

2.3. Run Data Migration Tool

Log in to the server or switch over to, as a user who has permission to write to the Magento file system.

2.3.1. For bash shell users, to switch to Magento file system owner, run:

su <Magento file system owner> -s /bin/bash - c <command>

2.3.2. Other ways:

cd <Magento install dir>/bin and run them as ./magento <command name>
php <Magento install dir>/bin/magento <command name>

Note: <Magento install dir> is a subdirectory of your web server’s docroot.

2.3.3. Command Syntax to Run DMT

bin/magento migrate:<mode> [-r| --reset] {<path to config.xml>}

Note:

  • <mode> = settings, data or delta
  • [-r| –reset] is an optional argument to start the migration from the beginning.

Modes in Data Migration Tool

The migration process is divided into three phases or modes to transfer and adapt data to the latest Magento version. The three modes are:

  • Settings mode: Migrate website-related setting and system configuration like payment, tax settings, etc.
  • Data mode: Migrate database assets in bulk
  • Delta mode: Migrate changes (since the last run) done by customers on storefronts like new orders and customers.
3 phases of migration to magento 2

Step 3: Automated Migration

3.1. To migrate settings, run command:

bin/magento migrate:settings [-r|--reset] {<path to config.xml>}

3.2. To migrate data, run the following:

bin/magento migrate:data [-r|--reset] [-a|--auto] {<path to config.xml>}

3.3. To migrate incremental changes, run:

bin/magento migrate:delta [-r|--reset] {<path to config.xml>}

Note: Press CTRL+C to stop run.

Step 4: Manual Migration

4.1. Media

If you have your media files in the Magento database, perform the following steps:

  1. Go Magento 1 Admin Panel
  2. System > Configuration > Advanced > System
  3. Scroll to Storage Configuration for Media
  4. Select Media Database list > Go to your media storage database > Synchronize

Repeat the same steps in Magento 2 Admin Panel.

If you have your media files in the file system, follow this:

  • Manually copy from /media to /pub/media.
  • Don’t copy the .htaccess files located in the Magento 1 media folder.

4.2. Storefront design

  • Design in files (CSS, JS, templates, XML layouts) changed its location and format
  • Layout Updates stored in the database. Placed through Magento 1 Admin in CMS Pages, CMS Widgets, Category Pages, and Product Pages

4.3. Access control lists (ACLs)

Recreate credentials for web services APIs and administrative user accounts.

Step 5: Magento Theme Migration

Although you can directly migrate your existing theme to M2, you have to dive deeper into the technical aspects.The XML structure of Magento 2 is different, so you can’t copy and paste the layout files. It is better to go with a premade Magento 2 theme.

Note: There are three running modes: default, developer, and production. Use the developer mode to develop and production mode once the site goes live.

Magento Migration Best Practices

1. Before migration, don’t create new entities (categories, products, etc) in Magento 2 store. The Data Migration Tool will overwrite new entities with the old ones from Magento 1.

2. Stop all Magento 1 cron jobs

3. During Migration:

  • Don’t alter codes
  • Don’t make changes in Magento 2 Admin and storefront
  • Don’t make any changes in the Magento 1 Admin except for order management (shipping, credit memos, invoice, etc)

4. To migrate customization, follow Code Migration Toolkit to help you convert Magento 1.x custom codes to Magento 2.

Conclusion

Magento 1 is structurally different from Magento 2, the migration process isn’t very easy. Want expert help? Talk to our experts and migrate Magento 1 to Magento 2 to get the most out of it.

  •  
  •  
  •  
  •  
  •  

2 Comments

  1. Marco

    Nice article, I’ll show this to our devs

    Reply
  2. Per Lars

    Great article. Did a migration successfully. Can recommend magentotool, for the module process. (To skip the boring part).

    Once I got my module folder I could fully focus on the migration part.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Magento Security eBook

Learn How To Hack-Proof Your Magento Store

This Ebook Is Going To Help You With Your Magento's Security, Secure Your Magento For Better SEO & More Revenue.

Thanks For Downloading Ebook