老婆跟我说过很多次了,总是懒不想导,因为比较麻烦。今天实在磨不过她,答应帮她弄。
首先搜索以前的邮件,找到服务器的密码。
开始用mysqldump导出整个数据库,哇,这么大了,356M,压缩以后都有56M。
这样不行,只导出weblogentry表,还是很大,而且导出来的数据很难过滤。
搜索了下,发现还有更好用的命令 select … into outfile,这样可以只导出需要的数据,那些回复就算了,只导出blog的正文就行了:

select concat(‘<tr><td>’,title,'</td>’),concat(‘<td>’,text,'</td>’),concat(‘<td>’,pubtime,'</td></tr>’) into outfile ‘/tmp/cherami.html’ from weblogentry where websiteid=’xxxxxx’ order by pubtime

然后加上HTML的头尾就可以直接看了:

<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
</head>
<body>
<table border="2">

</table>
</body>
</html>

呵呵,帮她弄完后顺带把自己的也导出来了,虽然原来用RSS导出了一部分,但是这次是全部,以后有时间再导进我的blog。

(Visited 111 times, 1 visits today)