emlog5.3升级到emlog6.0bate

看了看emlog新出来的6.0版本确实不错,于是就想着怎么把自己的博客升级上去,但按照论坛里的方法一直出错,所以小劣把自己的方法给出来,仅供参考。
首先你需要确定自己空间的php版本是5.3以上,最新的7.0也支持,但低于5.3版本则会报错
PHP不支持Mysql
确定PHP版本后即可开始,你可以选择解压emlog6.0的文件覆盖emlog5.3的,我个人是先备份好数据后,把除模板及上传文件外的文件都删除,然后重新安装6.0
安装完emlog6.0之后,打开phpmyadmin导入刚才备份的数据,这时候你访问的话是会出错的,需要升级数据库的结构才行,在phpmyadmin中运行SQL输入以下代码:

SET FOREIGN_KEY_CHECKS=0;

ALTER TABLE `emlog_attachment` MODIFY COLUMN `addtime`  bigint(20) NOT NULL DEFAULT 0 AFTER `filepath`;

ALTER TABLE `emlog_attachment` MODIFY COLUMN `width`  int(10) NOT NULL DEFAULT 0 AFTER `addtime`;

ALTER TABLE `emlog_attachment` MODIFY COLUMN `height`  int(10) NOT NULL DEFAULT 0 AFTER `width`;

ALTER TABLE `emlog_attachment` MODIFY COLUMN `mimetype`  varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER `height`;

ALTER TABLE `emlog_blog` DROP INDEX `hide`;

ALTER TABLE `emlog_blog` DROP INDEX `type`;

ALTER TABLE `emlog_blog` DROP INDEX `date`;

ALTER TABLE `emlog_blog` MODIFY COLUMN `title`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER `gid`;

ALTER TABLE `emlog_blog` MODIFY COLUMN `content`  longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `date`;

ALTER TABLE `emlog_blog` MODIFY COLUMN `excerpt`  longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `content`;

ALTER TABLE `emlog_blog` MODIFY COLUMN `alias`  varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER `excerpt`;

ALTER TABLE `emlog_blog` ADD COLUMN `tags`  text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `template`;

CREATE INDEX `top` ON `emlog_blog`(`top`, `date`) USING BTREE ;

ALTER TABLE `emlog_comment` MODIFY COLUMN `pid`  int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `gid`;

ALTER TABLE `emlog_comment` MODIFY COLUMN `poster`  varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER `date`;

ALTER TABLE `emlog_comment` MODIFY COLUMN `comment`  text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `poster`;

ALTER TABLE `emlog_link` MODIFY COLUMN `hide`  enum('n','y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'n' AFTER `description`;

CREATE TABLE `emlog_storage` (
`sid`  int(8) NOT NULL AUTO_INCREMENT ,
`plugin`  varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`name`  varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`type`  varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`value`  text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`createdate`  int(11) NOT NULL ,
`lastupdate`  int(11) NOT NULL ,
PRIMARY KEY (`sid`),
UNIQUE INDEX `plugin` (`plugin`, `name`) USING BTREE 
)
ENGINE=MyISAM
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
CHECKSUM=0
ROW_FORMAT=Dynamic
DELAY_KEY_WRITE=0
;

ALTER TABLE `emlog_tag` MODIFY COLUMN `gid`  text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `tagname`;

SET FOREIGN_KEY_CHECKS=1;
注意将emlog_替换成你自己的表前缀。
这一步基本就成功了,但你会发现好多地方没效果,只需要更新一下数据缓存就行。
版权声明:若无特殊注明,本文皆为( )原创,转载请保留文章出处。
小劣博客

小劣博客

骨有三分傲,情得一点痴

正文到此结束

热门推荐

发表评论

    正在提交中...

    captcha
    请输入验证码

    已有 6 条评论

    1. 据说6.0取消了微语功能,然后我就只能使用彩虹优化过的版本

    2. 过几天升级试试

    3. 6 不是测试版本的吗

    4. 谢谢博主,保存着

    5. EM6真不错。这方法要收藏备用,谢谢分享!