简体   繁体   English

将数据从自定义博客移至Wordpress?

[英]Moving data from custom blog to Wordpress?

Ok so i have this custom blog that i now need to move over to wordpress. 好的,所以我有这个自定义博客,现在我需要转到wordpress。 I tried using the import features in wordpress but that didnt work as planned. 我尝试在wordpress中使用导入功能,但是按计划工作不正常。 The custom blog is written in php and has a userscomments table, authors table, and posts table. 自定义博客是用php编写的,并且具有userscomments表,authors表和posts表。 Is there an easy way to move all these posts over to wordpress and preserve all the comments per post. 有没有一种简单的方法可以将所有这些帖子移至wordpress并保留每个帖子的所有评论。

If the custom blog doesn't have an export function that will dump its data into a format WordPress can read, then it may be that you'll have to roll your own. 如果自定义博客不具有将其数据转储为WordPress可以读取的格式的导出功能,则可能是您必须自己滚动。 There are 2 approaches: 有两种方法:

  1. Do a database-only import, using code or SQL tools along with information from the WordPress Codex entry on the WP database . 使用代码或SQL工具以及WP数据库上WordPress Codex条目中的信息,进行仅数据库的导入。 This will probably be fairly simple from a coding standpoint, but you have to make sure you get it right. 从编码的角度来看,这可能很简单,但是必须确保正确。
  2. Use the WordPress API to create the posts based on the output from the old system. 使用WordPress API根据旧系统的输出创建帖子。 This will involve a bit more learning, but it's the Right Way™ to do it, and means that you learn the WordPress API rather than the database structure. 这将涉及更多的学习内容,但这是正确的方法,它意味着您将学习WordPress API而不是数据库结构。

If I were doing it myself, I'd choose option #2. 如果我自己进行操作,则选择选项#2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM