跳至主要内容

[MT2WP] 从MovableType迁移到WordPress笔记

很值得借鉴!

MovableType+TWiki是一对经典的基于Perl的企业级内容管理方案,能应付较高的访问量;
WordPress+MediaWiki则是另外一组基于PHP的组合拳:有着非常平滑的学习曲线,非常适合中小型项目;隐约能够感觉到WordPress的成熟度也越来越高了,最近发现而新建的blog网站使用WP系统的非常多,而且 很多blogger都在考虑迁移中。

在实际的使用过程中,我也能感受到MT的很多问题,现将MT和WP的优缺点对比如下:
1 安装:程序分别部署在cgi-bin 和 发布目录下,比较难于维护。相比之下:WordPress的安装显得清晰很多;
2 调试:基于Perl,在虚拟主机不提供日志的情况下,MT的安装过程出现问题后非常难调试;
3 浏览机制:相对于于小型网站:在访问量不大的情况下:WP可以提供比MT更方便的类聚和扩展浏览模式;在SEO方面:WP利用 path_info机制也能达到和MT一样的效果。

WordPress的安装(需要有MySQL数据库支持)
1 下载:最新版本http://wordpress.org/download/
2 修改配置文件:wp-config-sample.php
define('DB_NAME', 'db name'); // The name of the database
define('DB_USER', 'db username'); // Your MySQL username
define('DB_PASSWORD', 'db password'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
另存成 wp-config.php
3 在虎翼网上:由于不能支持phpversion() 函数:需要将 wp-settings.php 文件中的16,17行改成:
if ( !('4.3.2' >= '4.1') )
die( 'Your server is running PHP version ' . '4.3.2' . ' but WordPress requires at least 4.1' );
或者干脆删除这2行:如果能保证服务器端PHP版本在4.1以上
4 上传文件:按照 http://www.example.com/wp-admin/install.php 的提示进行安装。

从MT迁移:
1 利用MT的import/export模块:
建议在IE下导出,在FIREFOX下会将html标记 < 转义成 <lt; 在导入到WP以后反而无法正常显示原先的内容了。
2 将导出文件存成 import.txt 上传到 wp-admin目录下:修改import-mt.php 的2行,将 'import.txt'文件名加入,上传。
注释:这个文件格式是Unix下的,在Windows下修改可能会出错,共享改好后的文件如下: Download file
3 访问: www.example.com/wp-admin/import-mt.php 按提示操作即可;


其他一些MT升级到WP后的注意事项:
1 PermaLink: 关于WP的PermaLink设计:使用中文文件名的时候有可能导致参数无法解析:
建议使用基于path_info的模板:/index.php/%year%_%monthnum%_%day%_%post_id%.html <=改用 %post_id%
另外:在目录设置中,将目录的后台名字Category slug命名成英文可以避免目录浏览的类似问题;
2 如果MT和WP在相同的目录下,迁移完成后:
需要将原来MT首页删除;
在MT的模板设置中:索引文件模板从输出为 index.html 改成index_mt.html 然后重建首页;
3 最近已经非常熟练的能够将 Blogger迁移到MT平台上:备忘一份如下,如果从Blogger迁移到WP,第一步模板部分是通用的。

Blogger.com 数据导出:严格按照MT的import from Blogger说明,Blogger一次性导出的上限是999条。
注意:数据迁移建议使用UTF-8格式即可 FTP服务器指向在国外的HOSTING速度会快很多;

迁移模板:
Blogger>
TITLE: <PostSubject><$BlogItemSubject$></PostSubject>
AUTHOR: <$BlogItemAuthor$>
DATE: <BlogDateHeader><$BlogDateHeaderDate$></BlogDateHeader> <$BlogItemDateTime$>:00
-----
BODY:
<$BlogItemBody$>
--------
</Blogger>

2 将数据迁移到 mt/import目录下:
有很多同一天的文章可能丢失了日期(blogger模板设置每天只显示一次日期),需要手工添加相应日期。
输出时间格式一定要按照: 17/9/2004 8:50:00 方式补齐

3 指定相应的:导入类目和文章状态,设置缺省为发布(publish)
用MT的import/export功能导入

[MTTips]: 最快速修改MT缺省模板的方法
MT模板缺省的字体对于中文显示来说太小:
编辑stylesheet 将模板中所有的x-small改成small即可。

评论

此博客中的热门博文

How to Design a Store Front Sign

In this Article we will talk about designing a store front for a business. What color or size should your Letters & designs be? What to put on your sign and why?, then be ready to Get in touch with sign people and get your best deal. Large lettering with out a front sign could save you time and money Do your products have a special shape or color to emulate on your sign? Kodak is always in yellow and black, Coca-Cola white on red, Etc. Muffler places, have a sign in the shape of a muffler. your phone number on the store front some place, but not on the identification sign, (door, or window) Your Product & logos can be arranged on the front sign, or window. Not on the Pole sign, Store hours & phone number could fit in your design and by using the product color, it could add product recognition & enhance your design. Suppliers may provide plenty of advert...

Can Microsoft and Yahoo Co-Create New Businesses?

Negotiating The Future of Management Podcast Current Interactive Case Study Respectfully there's a parallel in modern history here. China-HongKong merger. It started as Two System One China. Controversial at that time. Now, many don't mind which system is better (respectfully just an opinion). Both are getting the best of each other under one country. Families are reunited regularly. Corporate identities sometimes focuses too much on what's different as a strategy. It may provide superiority, but does it always guarantee sustainability? Nature advocates the flourishing of various species; pursues diversity not for purposes of destruction but for better adaptability. Of the whole system. Being different doesn't mean one must separate oneself from the "whole" system. "Different" here is to provide a unique contribution to pserve the "whole". Task / role distribution , not identity separation. Preserving the whole system by b...

MP3 firmware upgrade --- switch

1: The most simple if the host machine using Sigma firmware and upgrade program is one! MP3 can be connected to the computer as long as the firmware installed on the computer, and then click on the face of that to upgrade the line of MP3! three antelope 7530 master points in several ways is to first get the firmware is sent to the machine within the sub-sub-folder off the machine DVR will automatically upgrade! Detailed steps have been described in general firmware! Shenzhen City Qing Wei Digital Appliance Co., Ltd.-KINGWAY http://www.kingwon.com.cn/ Technology Co., Ltd. Shenzhen, Pu-chih http://www.poozi.com/down.asp?le ...% D4% D8 & offset = 5 Section Crystal: http://www.fangke-model.com/ Chuanqi (ONKI): http://www.onki.cn/download.asp brother extremely grateful! CDT CDT http://xinvo.com/web/ ExcelStor MP3 http://www.hua-sun.com/xiazai.htm Bester http://www.szbaisite.com Beto www.beto.cn Butterfly www.it8.com.cn Acorp www.acorp.net.cn BES www.bes-chi...