EE 1.14 Upgrade: Running the EE 1.12 and Earlier URL Redirect Script
This article is part of the Magento Enterprise Edition (EE) upgrade documentation. If you're looking for something else, click here to go back to the Magento Knowledge Base.
This article applies to the following Magento EE upgrades:
- From EE 1.12.x or earlier to EE 1.13.0.2
- From EE 1.12.x or earlier to EE 1.13.1.0
- From EE 1.12.x or earlier to EE 1.14.0.0
If your upgrade is not in the preceding list, go back to Upgrading to and Verifying Magento Community Edition (CE) 1.8 and Enterprise Edition (EE) 1.13.
This article discusses how to run the URL redirect script that creates HTTP 301 (Moved Permanently) redirects for any duplicate product URL keys. This enables Previous links in your web store to work, for example.
To create redirects for your URLs, perform the following tasks in the order shown:
- Verifying that cron is Disabled
- Changing Indexer Settings to Update When Scheduled
- Running the URL Redirect Script
- Running a Full Reindex from the Command Line
- Viewing the List of Redirects
- Verifying That URLs Work Properly
- Completing Your Upgrade
Verifying that cron is Disabled
It's very important to stop cron jobs from running until after the upgrade script completes. To do so, enter one of the following commands as a user with root
privileges:
- Ubuntu:
service crond stop
- CentOS:
service cron stop
Changing Indexer Settings to Update When Scheduled
To change indexer settings:
- Click System > Configuration.
- In the left navigation bar, in the ADVANCED group, click Index Management.
- In the right pane, expand Index Options.
- Click Update when scheduled from the list for every indexer.
The following figure shows an example.
- In the upper right corner, click Save Config.
Note: Ignore any messages requesting you to reindex or flush the cache; you'll do that later. - Log out of the Admin Panel.
- If the script ran without errors, continue with Running the URL Redirect Script.
Running the URL Redirect Script
This section discusses how to run the URL redirect script to create permanent redirects for any URLs that changed in EE 1.13.1.0.
To run the script:
- Change to your Magento installation directory.
- As the user who owns the files (typically, either
root
or the web server user), enter the following command:
php -f shell/url_migration_to_1_13.php - thread-count
where
thread_count is the number of threads to use. Magento recommends setting this to the number of CPU cores in your system minus 1 to a maximum of 15. For example, if your system has 8 CPU cores, enterphp -f shell/url_migration_to_1_13.php 7
Note: Each thread can use up to 512MB of RAM. - Wait while the script runs.
Messages like the following display to indicate progress:
[INFO]: Initialization... [INFO]: Renaming conflicting entities... 100% [#################################################################################] [INFO]: Creating redirects from previous version... 100% [#################################################################################] ETA HH:MM:SS
- If you have a large database, open another command window and run the following command:
watch -n1 "ps ax | grep umt | grep -v grep"
This command helps you to determine if each thread behaves correctly. After each process finishes, a new process should start immediately. There should be no delays or "hangs" between processes. - If the script runs successfully, continue with Running a Full Reindex from the Command Line.
If errors display, check [your Magento install dir]/shell/migration.log
for exceptions and see the following table.
Troubleshooting
Symptom | Suggested action |
---|---|
ERROR: Scope of attribute "url_key" is set to Global. This may cause DB inconsistency. Aborting. |
This error can be caused by either a product or category
|
Other errors | Try running the script again. If errors persist, contact Magento Support. |
Running a Full Reindex from the Command Line
After successfully running the URL redirect script, enter the following command from the Magento root directory:
php -f shell/indexer.php --reindexall
This command runs a full reindex and it might take a long time, depending on the size of your database.
After the reindex completes, enter the following command from your Magento installation directory:
rm -rf var/cache var/full_page_cache var/locks
Viewing the List of Redirects
As a result of running the URL redirect script, a list of redirects created for duplicate URL keys displays in the Admin Panel. To view these redirects:
- Log in to the Admin Panel as an administrator.
- Click Catalog > URL Redirects.
- To optionally sort results by description, click the Description column.
All redirects created by the URL redirect script display the following description:
1.12.0.2-1.13.x migration redirect
The following figure shows an example.
Verifying That URLs Work Properly
Assuming all your post-upgrade issues are fixed, go to your web store and navigate the category tree. Click some products and make sure they display properly. Verify that all Previous and Back links work properly.
Completing Your Upgrade
Complete your upgrade:
- Setting Up the Magento Cron Job
- Clearing Magento var/ Subdirectories
- Complete the remainder of the tasks on that page in the order shown