Home

Awesome

ConvertM1M2

Background

The purpose of this script is to automate as much as possible the initial conversion of a Magento 1 extension, and allow developers to have more time for tasks that can not be automated, such as:

NOTE: this script will not produce fully working code. A developer will have to manually go over each resulting file and test/fix it by hand.

Current status

Implemented:

Potentially to be implemented:

Partial list of known unknowns:

Installation and Usage

The script is fully standalone and self-contained, with the exception of SimpleDOM.php library, which is included in the package.

Fork/clone the repository, and edit convert.php file configuration (at the beginning of the file) if/as necessary.

The script can be ran from the Web or CLI, and allows conversion of multiple extensions at the same time.

When running from the web, no parameters can be accepted, and the script expects these locations:

When running from CLI, the following parameters are accepted (all optional):

php convert.php s=source m=mage1_folder o=output a=stage

An example of file and folders structure:

[] Web or CLI root
|
+-[] convertm1m2/
| +-() convert.php   - execute this script
| +-[] source/
|   +-[] Vendor_Module1/ - here are all the original files of your Magento1 extension, with full folder structure
|   +-[] Vendor_Module2/
|     +-[] app/code/community/Vendor/Module2/...
|     +-[] app/etc/modules/Vendor_Module2.xml
|     +-[] skin/frontend/base/default/...
|
+-[] magento/           - Magento 1 root folder with all core code, extensions to be converted, and dependencies
| +-[] app/
| +-[] skin/
| +-[] ...
|
+-[] magento2/          - Magento 2 root folder
| +-[] app/
|   +-[] code/
|     +-[] Vendor/
|       +-[] Module1/   - here are the resulting output files of the converted extension
|       +-[] Module2/

Steps after automatic conversion

Disclaimers

Our conversion tool is a work in progress and may not necessarily be the best solution for converting your existing extension.

Some developers may opt to start development from scratch and this might be a better choice.

For those who do opt to use this script - there are no guarantees made about any correctness or completeness of the result.

The purpose of this script is only to reduce some repetitive work which can be automated.

Contributing

All contributions are welcome, especially from Magento2 core developers :)

We want feedback, PRs and success stories!