最近本身搞了个域名,想把本身在CSDN上面的博客所有转到wordpress上面(虽说本身在CSDN上写博客的时间并非很长,呵呵
)。html
第一步
linux
CSDN是没有导出功能的,因此我先在博客园注册了一个帐号,而后把本身在CSDN上面的博客所有转到了博客园上面。服务器
第二步app
在博客园上本身的博客有一个“管理选项”,里面有一个博客备份的功能。备份完成之后会生成一个.xml文件。ide
可是这里要注意的是这个备份的.xml文件是只能在博客园上能够导入的(也就是说备份的文件只有在博客园上才能彻底使用)。不一样的博客系统的.xml的内部格式是不同的。因此咱们必须进行格式的转化。wordpress
进去wordpress的“导入”这一栏里面看一下,没有发现能从博客园导入到wordpress的工具(固然没有了
)工具
第三步
post
可是本身能力有限,又写不出转换的脚本,因此去网上搜索了下,找到了下面这个博客this
http://www.cnblogs.com/whoknows/articles/2246974.htmlspa
里面有他本身写的脚本转换工具,下面是具体的使用方法和下载地址:
使用方法:
- 在cnblogs选择备份数据,导出一个XML到本地;
- 下载附件中的插件,安装至\wp-content\plugins目录;
- 后台开启插件后,能够在“工具”中找到“Cnblogs数据转换”,进入;
- 选择刚才下载的XML文件,上传后系统会自动将数据转换并导入到wordpress中
下载地址: http://files.cnblogs.com/aiyuchen/cnblog.rar
在这里先谢谢他了。
第四步
按照使用方法打开wordpress在工具这个选项里面导入从博客园备份的.xml文件,就会发现本身的博客已经很顺利地转入到wordpress里面了!!
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
P.S.一开始的时候没看清楚,觉得导入工具里面的wordpress能够把.xml文件给导入。(其实这个工具理论上来说只能导入从wordpress导出的.xml文件)
而后没有通过数据转换就导了,发现下面这个错误(下面这个错误适用于从wordpress导出的备份文件从新导入到wordpress,我目前使用的wordpress版本是3.3.1):
Sorry, there has been an error.
This does not appear to be a WXR file, missing/invalid WXR version number.
大意是说没有WXR的版本号吧。因而拼命地找错误,发现了2个可能因素
1.打开本身的.xml文件,发现没有下面这句话,因而加上。
<wp:wxr_version>1.1</wp:wxr_version>
可是仍是报上面的错误,因而接着找解决方案,再次发现了一个可能因素
2.下面这段话转自wordpress的官方讨论区 http://wordpress.org/support/topic/xml-to-wxr-issue
I got hit with a similar situation.
In my case, It turned out to be a file permission/ownership issue. It appears that the WP core functions the importer plugin uses to upload the file do not provide error reporting for an instance where the the uploads, latest year and month directories exist but WordPress doesn't have the ownership and permission to write the file to the latest month dir. In this particular case the error reporting falls back to the plugin and
Sorry, there has been an error.
This does not appear to be a WXR file, missing/invalid WXR version number.
is the resulting error.
So if it happens to you on a unix box... chown or chmod your latest month's directory and it may fix the import issue.
Hope that helps.
大意是说这个是由于服务器主机的权限问题,是新建立的文件夹权限没有写的权限,因此wordpress没法读入
若是主机是linux的,那么解决办法是这样的
修改下面这个目录的权限,通常改成775就能够了
wordpress\wp-content\uploads\2012\02
关于权限的修改,给出下面这个连接
http://codex.wordpress.org/Changing_File_Permissions#Permission_Scheme_for_WordPress