以前的开发人员建立了一个网站,其中包含数以千计的新闻和数据。活动项目。问题是他创建了数据库以使用他自己的CMS。我们现在正在使用Wordpress,因此希望将此数据迁移到WP数据库中。
问题是数据略有不同,需要进行一些操作才能导入。有没有人建议一个简单的方法来做到这一点?
我需要原始数据库中的旧数据采用新Wordpress数据库的格式。请记住,有数百个条目,所以它不是复制和粘贴工作!
我已将示例导出为XML(导出时的CSV遍布各处):
这构成了原始自定义CMS中的事件:
<database name="medicom_medi">
<!-- Table myevents -->
<table name="myevents">
<column name="id">13</column>
<column name="title">This is the title</column>
<column name="description">This is the content</column>
<column name="mediwales_event">0</column>
</table>
</database>
<database name="medicom_medi">
<!-- Table myevents_dates -->
<table name="myevents_dates">
<column name="id">22</column>
<column name="eventid">13</column>
<column name="datefrom">2011-01-31 00:00:00</column>
<column name="dateto">0000-00-00 00:00:00</column>
<column name="venue">PA Consulting Group</column>
<column name="address">123 Buckingham Palace Rd, London SW1W 9SR</column>
</table>
</database>
这是我在Wordpress中需要数据的格式:
<database name="medicom_v3">
<!-- Table wp_posts -->
<table name="wp_posts">
<column name="ID">3871</column>
<column name="post_author">1</column>
<column name="post_date">2012-04-10 10:00:34</column>
<column name="post_date_gmt">2012-04-10 10:00:34</column>
<column name="post_content">Testing</column>
<column name="post_title">Test event 2</column>
<column name="post_excerpt"></column>
<column name="post_status">publish</column>
<column name="comment_status">closed</column>
<column name="ping_status">closed</column>
<column name="post_password"></column>
<column name="post_name">test-event-2</column>
<column name="to_ping"></column>
<column name="pinged"></column>
<column name="post_modified">2012-04-10 10:00:34</column>
<column name="post_modified_gmt">2012-04-10 10:00:34</column>
<column name="post_content_filtered"></column>
<column name="post_parent">0</column>
<column name="guid">http://www.mediwales.com/v3/?post_type=tribe_events&#038;p=3871</column>
<column name="menu_order">0</column>
<column name="post_type">tribe_events</column>
<column name="post_mime_type"></column>
<column name="comment_count">0</column>
</table>
</database>
<database name="medicom_v3">
<!-- Table wp_postmeta -->
<table name="wp_postmeta">
<column name="meta_id">14580</column>
<column name="post_id">3871</column>
<column name="meta_key">_EventShowMapLink</column>
<column name="meta_value">false</column>
</table>
<table name="wp_postmeta">
<column name="meta_id">14581</column>
<column name="post_id">3871</column>
<column name="meta_key">_EventShowMap</column>
<column name="meta_value">false</column>
</table>
<table name="wp_postmeta">
<column name="meta_id">14582</column>
<column name="post_id">3871</column>
<column name="meta_key">_EventAllDay</column>
<column name="meta_value">yes</column>
</table>
<table name="wp_postmeta">
<column name="meta_id">14583</column>
<column name="post_id">3871</column>
<column name="meta_key">_EventStartDate</column>
<column name="meta_value">2012-04-17 00:00:00</column>
</table>
<table name="wp_postmeta">
<column name="meta_id">14584</column>
<column name="post_id">3871</column>
<column name="meta_key">_EventEndDate</column>
<column name="meta_value">2012-04-17 23:59:59</column>
</table>
<table name="wp_postmeta">
<column name="meta_id">14585</column>
<column name="post_id">3871</column>
<column name="meta_key">_EventVenueID</column>
<column name="meta_value">0</column>
</table>
<table name="wp_postmeta">
<column name="meta_id">14586</column>
<column name="post_id">3871</column>
<column name="meta_key">_EventCost</column>
<column name="meta_value"></column>
</table>
<table name="wp_postmeta">
<column name="meta_id">14587</column>
<column name="post_id">3871</column>
<column name="meta_key">_EventOrganizerID</column>
<column name="meta_value">0</column>
</table>
</database>
答案 0 :(得分:2)
由于它是一个自制的CMS,您很可能找不到任何工具将所有代码翻译成WordPress格式。
我会制作一个脚本(php或其他)来转换这个巨大的转储。 我认为WordPress(或插件)可以读取XML,因此您只需调整结构和键。