blog migration

第一步

CSDN是没有导出功能的,所以我先在博客园注册了一个账号,然后把自己在CSDN上面的博客全部转到了博客园上面。

 

第二步

在博客园上自己的博客有一个“管理选项”,里面有一个博客备份的功能。备份完成以后会生成一个.xml文件。

但是这里要注意的是这个备份的.xml文件是只能在博客园上可以导入的(也就是说备份的文件只有在博客园上才能完全使用)。不同的博客系统的.xml的内部格式是不一样的。所以我们必须进行格式的转化。

 

进去wordpress的“导入”这一栏里面看一下,没有发现能从博客园导入到wordpress的工具(当然没有了睡觉

 

第三步

但是自己能力有限,又写不出转换的脚本,所以去网上搜索了下,找到了下面这个博客

http://www.cnblogs.com/whoknows/articles/2246974.html

 

里面有他自己写的脚本转换工具,下面是具体的使用方法和下载地址:

使用方法:

  • 在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

 

 
 

转载于:https://www.cnblogs.com/isohybrid/p/migration.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值