Magento upgrade to 1.5.x or 1.6.x VIA SSH

2,455次阅读
没有评论

共计 4803 个字符,预计需要花费 13 分钟才能阅读完成。

As many magento users will know, Magento is no fun to work with– mainly due to poor community support (the developers help paying customers; i.e. Magento Enterprise … Only payed support there… Great for business but bad for the average or beginning user…)

Anyhow…

So here’s how we do it.

MAKE A BACKUP!

You can skip this step all together, however, please make a backup of everything prior to beginning the upgrade.

Create a test environment somewhere on your server (preferably away from your production installation)

    1. I usually create a subdomain on another domain and put all the files there.
    2. Create a new database for this sub-domain.
    3. Make a backup of the current database in SSH via:
      $ mysqldump -u user -p DB_NAME > DB-NAME.sql
    4. Dump the backup you just made into your new database
      $ mysql -u user -p DB_NAME < DB-NAME.sql
    5. Change the database settings to point to new database
      $ vi app/etc/local.xml
    6. Change your magento URLs
      In phpmyadmin go to table ‘core_config_data’ and change ‘web/unsecure/base_url’ and ‘web/secure/base_url’ to new location
    7. REMEMBER to update steps 5-6 after the upgrade is done and upgraded files and database are transferred to the production environment.

Upgrade Magento from 1.4.x to 1.5.x

1. download the latest version of Magento

$ wget http://www.magentocommerce.com/downloads/assets/1.5.1.0/magento-1.5.1.0.tar.gz
(magento 1.6) $ wget http://www.magentocommerce.com/downloads/assets/1.6.0.0/magento-1.6.0.0.tar.gz
$ tar xvfz magento-1.5.1.0.tar.gz
(magento 1.6) $ tar xvfz magento-1.6.0.0.tar.gz

2. Disallow access to your site if doing the upgrade on a production environment (this is why you should do this on a test environment)

$ mv .htaccess .htaccess-bkp
$ cp magento/.htaccess .
$ cp .htaccess .htaccess-new

In your new .htaccess change the Order Allow to (at the bottom of file):

#Order allow,deny
#Allow from all
Order deny,allow
Deny from all
Allow from YOUR IP ADDRESS

Also, up the memory usage (especially if your database backup is over 500MB–hopefully you’re running magento on a dedicated server.)

php_value memory_limit 1024M
php_value max_execution_time 45000

3. Flush all caches

$ rm -rf var/cache/*
$ rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*

4. Remove the ‘downloader’ and ‘app/design/frontend/base’ directory

$ rm -rf downloader
$ rm -rf app/design/frontend/base

This is the safest bet so mage/pear doesn’t upgrade the wrong installation; trust me this happened to me a couple of times, EVEN after doing ‘ mage-setup’.

As for the ‘base’ directory, we remove that because deprecated files exist in there that may cause problems. E.g. One page checkout would not work for anon users, but would work for registered users–and this happened even when all the files were overwritten with magento 1.5.1; meaning magento was picking up deperectated files.

5. Copy ‘downloader’ and ‘app/design/frontend/base’ folder from magento-1.5.1.0

$ cp -a magento/downloader .
$ cp -a magento/app/design/frontend/base/ app/design/frontend/

6. Install/get ‘mage’.

$ cp magento/mage .
$ chmod 550 ./mage

or
$ chmod 750 ./mage

We do this because the ‘pear’ method doesn’t work anymore–it only does an upgrade up to magento 1.4.2; it won’t work upgrading any higher than that.

7. Do the upgrade

$ ./mage mage-setup .
$ ./mage sync --force
$ ./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force
$ rm -rf var/cache/*
$ rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
$ chmod 755 mage
$ ./mage upgrade-all --force

8. Visit the home page of your upgraded site. This will trigger the magento upgrade process.

9. Login to the /admin section of your site and mage sure the version number reflects the version you just upgraded to.

10. Change back your .htaccess to original value

$ cp .htaccess-new .htaccess

11. Set the proper file permissions

$ find . -type f -exec chmod 644 {} \;
$ find . -type d -exec chmod 777 {} \;
$ chmod -R 777 download
$ chmod 550 mage
$ chmod o+w var var/.htaccess app/etc
$ chmod -R o+w media

 

11. You’ll probably want to use a file comparison program to see the difference in template files

  • download the latest version from magento connect if possible
  • if not possible and you made your own template, then the best thing to do is to DELETE all the unecessary custom template files from your custom template directory, and only keep the crucial ones.
  • Following use something like Beyond Compare and file compare between the /base/default
    app/design/frontend/base/default
    and
    /app/design/frontend/default/CUSTOM

 

Troubleshooting

Now…

If something went wrong (and it probably did) you have several options.

If a newer version 1.6.x-RC is showing then mage installer grabbed the release candidate stuff instead.

The fix:

$ yes | cp -Rf magento/* .

This will copy the proper version of magento overwriting your current installation

The site just hangs after upgrade (keeps loading for minutes on end):

Blah… the database upgrade didn’t work…

Go into phpmyadmin and drop all the tables so your database is empty (you’ll get errors in phpmyadmin about foreign keys; that’s normal, just repeat till all tables are gone) (i prefer this over the SSH method, cause it’s too easy to drop the wrong database by accident)

Now re-dump your database backup

$ mysql -u user -p DB_NAME < DB-NAME.sql

and copy over a fresh version of magento over your current install

$ yes | cp -Rf magento/* .
$ rm -rf var/cache/*
$ rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*

Visit your site again…

Bonus:
Install Google Base (shopping) vis SSH

$ ./mage install http://connect20.magentocommerce.com/community Mage_GoogleShopping --force

正文完
 0
评论(没有评论)

空瓶子部落

文章搜索
推荐阅读
华为干部管理七步曲

华为干部管理七步曲

华为干部管理七步曲 1.明确使命与责任:干部需践行和传承公司核心,价值观,聚焦客户需求,抓业务增长,同时开展端...
TaleBook | 用NAS打造私人图书馆,一款基于Calibre的个人图书管理器

TaleBook | 用NAS打造私人图书馆,一款基于Calibre的个人图书管理器

TaleBook 介绍 TaleBook 是一个开源项目,为爱书之人精心设计;简洁但强大的私人书籍管理系统;它...
稳了,搭建Docker国内源图文教程

稳了,搭建Docker国内源图文教程

大家好,之前分享了开源作品 Cloudflare Workers Proxy,它的作用是代理被屏蔽的地址,理论...
永久免费获取4H8G云服务器-Claw Cloud Run

永久免费获取4H8G云服务器-Claw Cloud Run

Claw Cloud Run是阿里云旗下的一个在线开发平台,类似于vercel这类自部署平台。 所有用户现在注...
DFMEA 与 PFMEA预防措施的不同-以装配过程为例

DFMEA 与 PFMEA预防措施的不同-以装配过程为例

在汽车制造领域中,DFMEA(设计失效模式与影响分析)和 PFMEA(过程失效模式与影响分析)都扮演着极为重要...
最新文章
群晖 Let’s Encrypt 泛域名证书自动更新

群晖 Let’s Encrypt 泛域名证书自动更新

目前acme协议版本更新,开始支持泛域名(wildcard),也就是说,可以申请一个类似*.domain.co...
可以卸载TV Box 了,这款支持「绅士模式」的影视神器你值得拥有

可以卸载TV Box 了,这款支持「绅士模式」的影视神器你值得拥有

还在为找优秀片源难、广告多、平台会员太贵而烦恼?今天给大家挖到一款真正的影视宝藏工具——小猫影视! 作为开源免...
【收藏】一次性解决TV点播/直播自由

【收藏】一次性解决TV点播/直播自由

很多时候,资源就在面前,但是我们视而不见,因为长久的安逸,已经让人失去动手的兴趣。但是每次我需要挨个切换APP...
OpenWrt 存储空间扩容的两种方案

OpenWrt 存储空间扩容的两种方案

说明:当我们通过群晖 VMM 虚拟机安装 Open­Wrt 时,默认会分配一个 10GB 的存储空间,而实际情...
OpenWrt修改IP地址两种方法(直接命令修改跟后台修改)

OpenWrt修改IP地址两种方法(直接命令修改跟后台修改)

OpenWrt是什么?OpenWrt一般常见于无线路由器(软路由)第三方固件,它是一个高效、可靠、功能多的路由...
热门文章
提高过程能力指数(CP/CPK)的途径

提高过程能力指数(CP/CPK)的途径

编者按:过程能力指数(CP/CPK)想必各位质量人都耳熟能详、运用自如,质量工程师之家前期也共享过数篇关于过程...
SPC控制图的八种模式分析

SPC控制图的八种模式分析

SPC控制图有八种模式,即八种判断异常的检验准则,每一种检验准则代表一种异常现象,应用SPC控制图进行过程评估...
测量高手放大招:圆跳动测量技巧总结

测量高手放大招:圆跳动测量技巧总结

01. 前言 在五金机加工厂实际的测量工作中,经常碰到要求测量两个要素的圆跳动问题, 利用不同的测量辅件及夹具...
过程能力分析(CP&cpk)

过程能力分析(CP&cpk)

引入过程能力分析的目的? 在我们现有的管理过程中,我们经常会遇到有些具体指标总是不尽人意,存在许多需要改进的地...
新能源汽车 “两会”精神宣贯会

新能源汽车 “两会”精神宣贯会

此次和大家分享新能源汽车相关政策: [embeddoc url=”https://www.ctro...
最新评论
多乐士 多乐士 通过摸索发现ssh拉取会报错,直接网页访问下载会报404错误,不知道原因;但是可以通过群晖CM注册表访问下载,其方法如下: Container Manager-注册表-设置-新增-注册表名称随便写,注册表URL填你的加速地址,勾选信任的SSL自我签署证书,登录信息不填-应用-使用你的地址,这是注册表会显示了,在搜索栏中输入映像名称,搜索结果在每一页的最后一个,你需要划到最后一个进行下载,实测可正常下载安装。 以上供网友参考。
多乐士 多乐士 还有一个比较简单的方法,只是需要一些外部工具。 1、讲损毁硬盘取出,装入外部移动硬盘 2、打开Diskgenius,定位到硬盘 3、格式化系统分区 4、重新插入硬盘 5、存储池->修复存储池即可
多乐士 多乐士 写的不错的文章
辞了老衲 辞了老衲 这个确实有帮助。
渋驀 渋驀 当然任何时候都可以用curl命令和crontab来实现动态更新DDNS的ip地址: 1、安装crontab之后为root用户创建文件/var/spool/cron/root 2、创建并配置ddnsupdate.sh,放到/usr/bin/文件下,文件内容(以he.net为例): Autodetect my IPv4/IPv6 address: IPV4:curl -4 "http://dyn.example.com:password@dyn.dns.he.net/nic/update?hostname=dyn.example.com" IPV6:curl -6 "http://dyn.example.com:password@dyn.dns.he.net/nic/update?hostname=dyn.example.com" 3、添加执行权限chomod +x /usr/bin/ddnsupdate.sh 4、编辑root用户的crontab:*/10 * * * * /usr/binddnsupdate.sh,每10分钟执行一次。好了,可以享受你的DDNS了
21410 21410 请问下载链接在那里?
madkylin madkylin 不错,不错,谢谢分享了,好东西啊 :lol:
feilung feilung 求方法
zengsuyi zengsuyi 应该挺不错的
zise zise 看看是怎么操作的。。 :oops: