How to migrate Magento Professional to Magento Community or Enterprise

In this article we will share universal instruction on how to migrate your Magento Professional store to Magento Community or Magento Enterprise.

The migration process is quite complex, so make sure that the developers who are responsible for this migration project are certified Magento developers.

1. Prepare for the migration

Copy your Magento Pro to a development server.

Never upgrade live store directly!

On this stage we will prepare development environment for migration. First of all copy your Magento Pro store to a separate development environment (e.g. development server).

It is highly recommended to make it completely separate from your live store. Database upgrade is resource heavy operation and if you will do it on live environment, most likely your server will terminate DB upgrade process and upgrade will be half-done.

Prepare server environment.

We recommend to change these development server settings:

  • Increase PHP memory
  • Increase PHP execution time
  • Increase MySQL 'wait_timeout' in my.cnf configuration file (e.g. to 28800 seconds)
  • Increase MySQL 'max_allowed_packet' in my.cnf (e.g. to 64 Mb)

Prepare Magento Professional copy for migration.

We recommend to do the following before migration:

  • Close development copy from web access using .htaccess (you can use 'Deny from all' command)
  • Make sure that logging is activated in Magento Pro, so you can access the errors logs
  • Clear Magento Pro cache and sessions
  • Clear Magento log tables in MySQL

2. Upgrade the core

Download the latest Magento Community or Magento Enterprise package and unzip it to the separate folder on development server. Next, move the Magento CE/EE core files from unzipped distributive to Magento Professional copy that you created. This way you will replace the Magento Pro core with Magento CE/EE core.

Please note that any core hacks in your Magento Professional will be lost after core replacement. Magento is modular system and it is always recommended to customize it according to best practices via modules, instead of dirty core hacks.

3. Initiate upgrade of the database

This is the most important stage. The new core will start database upgrade/DB transformation process, and this is why we increased server settings values. The process should run smoothly without any server side interruptions.

You can execute DB upgrade process via SSH shell, example:

php -f ./index.php &

The process could take several hours so be patient and monitor the command output for unexpected errors. If you get an error, please check the 'Troubleshooting' in this article, hope it will help you to complete the migration.

4. Troubleshooting

1. MySQL errors of this type:

Error on rename of './#sql-16e4_c99b' to './magento__core_url_rewrite' (errno: 150)

If you get such error during DB upgrade try the following solution:

  • Connect to your server via SSH, login to MySQL console and execute this command: SHOW ENGINE INNODB STATUS
  • Check the LATEST FOREIGN KEY ERROR section

You will see something like this:

------------------------
LATEST FOREIGN KEY ERROR
------------------------
130208  2:32:08 Error in foreign key constraint of table /magento__core_url_rewrite:
there is no index in the table which would contain the columns as the first columns, or the data types in the table do not match the ones in the referenced table or one of the ON ... SET NULL columns is declared NOT NULL. Constraint: , CONSTRAINT "magento__core_url_rewrite_ibfk_1" FOREIGN KEY ("category_id") REFERENCES "magento__catalog_category_entity" ("entity_id") ON DELETE CASCADE ON UPDATE CASCADE

To fix the error you should execute the following command in MySQL, it will fix the "magento__core_url_rewrite_ibfk_1" foreign key issue:

ALTER TABLE magento__core_url_rewrite DROP FOREIGN KEY magento__core_url_rewrite_ibfk_1;

Next, execute the DB upgrade once again. If you will get the same error (errno: 150) connected with different table, just repeat the actions for other table/foreign key.

2. Password reset error:

If you see such error during reset password feature testing:

Fatal error: Call to a member function setCustomerId() on a non-object in /app/code/core/Mage/Customer/controllers/AccountController.php on line 601

Open the /app/design/frontend/[your_theme_package]/[your_theme_name]/layout/customer.xml file and add this section to the XML:


<customer_account_resetpassword translate="label">
    <label>Reset a Password</label>
    <remove name="right"/>
    <remove name="left"/>
    <reference name="head">
        <action method="setTitle" translate="title" module="customer">
            <title>Reset a Password</title>
        </action>
    </reference>

    <reference name="root">
        <action method="setTemplate">
            <template>page/1column.phtml</template>
        </action>
        <action method="setHeaderTitle" translate="title" module="customer">
            <title>Reset a Password</title>
        </action>
    </reference>
    <reference name="content">
        <block type="customer/account_resetpassword" name="resetPassword" template="customer/form/resetforgottenpassword.phtml"/>
    </reference>
</customer_account_resetpassword>

3. CSS/templates issues:

Quite possible that CSS templates tweaks will be needed, since the Pro and EE/CE features are different. It is not possible to write an article about all such issues for all stores, so just try to debug them and fix.

4. 3-rd party modules issues:

In most cases re-installation of the modules will be needed, since Magento Pro and CE/EE modules could be not compatible. If you will see any 3-rd party modules related issues, request Magento CE/EE modules versions from modules vendors.