我有一个从旧的自定义博客cms数据库的sql文件。我正试图把这些文章导入wordpress,但我现在被卡住了。到目前为止,我已经成功地隔离了cms的表结构(见下文)。我还确定了我需要的列。它们是(文章、标题、日期、图像、类别)。现在我必须把这些列Map到wordpress模式中的一些列,这就是我被卡住的地方。
以下是数据库的sql结构:
CREATE TABLE `ads_ng_ads` (
`id` int(10) unsigned NOT NULL auto_increment,
`ad_type` enum('media','text','html') character set latin1 collate latin1_bin NOT NULL,
`media_type` enum('image','flash','other') character set latin1 collate latin1_bin default NULL,
`media_width` smallint(6) default NULL,
`media_height` smallint(6) default NULL,
`media_size` int(6) default NULL,
`media_path` varchar(128) character set latin1 collate latin1_bin default NULL,
`uri` varchar(128) character set utf8 collate utf8_bin NOT NULL,
`is_hidden` tinyint(1) NOT NULL,
`created_on` int(11) NOT NULL,
`active_from` int(11) NOT NULL,
`active_to` int(11) NOT NULL,
`room_id` int(11) default NULL,
`geo_target` int(11) default NULL,
`alternative` text character set utf8 NOT NULL,
`zone_target` text character set ascii collate ascii_bin NOT NULL,
`uri_target` text character set utf8 collate utf8_bin NOT NULL,
PRIMARY KEY (`id`),
KEY `zone_target` (`is_hidden`,`active_from`,`active_to`,`geo_target`)
) ENGINE=MyISAM AUTO_INCREMENT=757 DEFAULT CHARSET=latin1;
CREATE TABLE `ads_ng_statistics` (
`ad_id` int(10) unsigned NOT NULL,
`date` int(11) NOT NULL,
`views` mediumint(8) unsigned NOT NULL default '0',
`clicks` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`ad_id`,`date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `countries` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(100) NOT NULL,
`alias` varchar(3) NOT NULL,
`restricted` tinyint(3) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=253 DEFAULT CHARSET=utf8;
CREATE TABLE `featured_column` (
`id` int(11) unsigned NOT NULL auto_increment,
`date_modified` timestamp NOT NULL default CURRENT_TIMESTAMP,
`date_created` timestamp NOT NULL default '1000-01-01 00:00:00',
`title` varchar(255) NOT NULL,
`alias` varchar(255) NOT NULL,
`body` text NOT NULL,
`body_html` text NOT NULL,
`user_id` int(11) NOT NULL,
`tags` varchar(255) NOT NULL,
`summary` varchar(255) NOT NULL,
`in_homepage` int(1) NOT NULL default '0',
`img_title` int(1) NOT NULL default '0',
`meta_t` varchar(255) NOT NULL,
`meta_k` varchar(255) NOT NULL,
`meta_d` varchar(255) NOT NULL,
`public` int(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1381 DEFAULT CHARSET=utf8;
1条答案
按热度按时间lh80um4z1#
假设您使用的是最新的wordpress版本(4.9.1),您只需要创建一个脚本,将所有数据导入wp\u posts表,例如,如果您想作为wordpress posts导入。例如:“title”到“post\u title”,“post”到“post\u content”等。