开发者

Magento: why does upgrade from 1.5 to 1.6RC1 CE take so long?

I was able to upgrade Magento from 1.4 to 1.5 in very little time, i.e. seconds. Going from 1.5 to 1.6 RC1 seems to be taking a very long time, as in hours (lost track of time, but heading for two hours and counting).

I cleared out log tables and dataflow import/export tables to leave ~10K SKUs and a few thousand customer records. The data is also on a new import, so it should not have corrupted tables or anything else abnormal. According to 'top' mysqld is going flat out, albeit on 34% wait.

Is ~2+ hours to be expected for upgrading latest Magento CE?

P.S. I know this is not really a programming question and more of an installation problem, 开发者_StackOverflow中文版however, I would like to know a little bit more about what it is doing to take so long.

EDIT: After many hours and many tables added, this install baled.

Any tips on how to get 1.6 working on an existing dataset will be most appreciated.


I just upgraded from 1.5 to 1.6.2 after about 10 failed attempts. I've learned a ton about the process, so hopefully someone will find this useful.

Upgrades to 1.6 are going to take ages to run. There seems to be a big difference in the database structure between versions, so there are about 6 or 8 hours of SQL commands to run. Mainly ALTER TABLE commands which can take over a hour to run (each) if the tables are full of records. To reduce the amount of time this take, run this command (make sure to change the 'sb_' table prefix to your own one)

DELETE FROM sb_sales_flat_quote WHERE updated_at < DATE_SUB(Now(),INTERVAL 7 DAY)

It will delete all shopping carts except for the last week. Will reduce to approx. 10,000 records from over 250,000 in my case. As far as I can tell, this won't affect customers.

Also, empty these tables (make sure to change the 'sb_' table prefix to your own one):

TRUNCATE `sb_log_customer`;
ALTER TABLE `sb_log_customer` AUTO_INCREMENT=1;
TRUNCATE `sb_log_quote`;
ALTER TABLE `sb_log_quote` AUTO_INCREMENT=1;
TRUNCATE `sb_log_summary`;
ALTER TABLE `sb_log_summary` AUTO_INCREMENT=1;
TRUNCATE `sb_log_summary_type`;
ALTER TABLE `sb_log_summary_type` AUTO_INCREMENT=1;
TRUNCATE `sb_log_url`;
ALTER TABLE `sb_log_url` AUTO_INCREMENT=1;
TRUNCATE `sb_log_url_info`;
ALTER TABLE `sb_log_url_info` AUTO_INCREMENT=1;
TRUNCATE `sb_log_visitor`;
ALTER TABLE `sb_log_visitor` AUTO_INCREMENT=1;
TRUNCATE `sb_log_visitor_info`;
ALTER TABLE `sb_log_visitor_info` AUTO_INCREMENT=1;

TRUNCATE `sb_report_viewed_product_index`;
ALTER TABLE `sb_report_viewed_product_index` AUTO_INCREMENT=1;
TRUNCATE `sb_report_compared_product_index`;
ALTER TABLE `sb_report_compared_product_index` AUTO_INCREMENT=1;
TRUNCATE `sb_report_event`;
ALTER TABLE `sb_report_event` AUTO_INCREMENT=1;
TRUNCATE `sb_catalog_compare_item`;
ALTER TABLE `sb_catalog_compare_item` AUTO_INCREMENT=1;

Before you start the upgrade, make sure to disable the cache! This will save headaches. Also, either uninstall/disable any extensions, or upgrade them. This includes ones manually installed, not just the ones in Magento connect.

If you want to know what SQL commands are being issues by the upgrade enable Magento debugging, by editing /lib/Varien/Db/Adapter/Pdo/Mysql.php. Change the following lines to true:

protected $_debug               = true;
protected $_debuglogeverything  = true;

You'll then find all commands in /var/debug/pdo_mysql.log (you can watch them on-the-fly by SSHing into your server, going to /var/debug/ and typing

tail -f *

The way I upgrade is by FTPing in and copying the newest version of Magento over the current installation. This works for me. I use CPanel's File Manager to extract the magento-1.x.x.x.tar.gz file. (BTW: TAR.GZ is better than ZIP file because it includes file permission information)

Also, add this to your .htaccess file to block everyone except your own IP (change IP to you own). You also need to create a maintenance.html file. This will stop visitors kicking off the upgrade process too early. Rename /cron.php for the same reason.

## Exception Below is your IP 
RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444
RewriteCond %{REQUEST_URI} !/maintenance\.html$ 
RewriteRule .* /maintenance.html [R=302,L]

After the 1.6.2.0 upgrade was finished, I rebuilt Indexes. Upgrading to 1.7.0.2 from that point took about 30 seconds.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜