Skip to content

Instantly share code, notes, and snippets.

@gjergjsheldija
Created August 10, 2015 10:56
Show Gist options
  • Save gjergjsheldija/fb69af30db8dc299971a to your computer and use it in GitHub Desktop.
Save gjergjsheldija/fb69af30db8dc299971a to your computer and use it in GitHub Desktop.
migrate from cms made simple to wordpress
-- news
INSERT INTO `wp_posts` (
`post_author`,
`post_date`,
`post_date_gmt`,
`post_content`,
`post_title`,
`post_excerpt`,
`post_status`,
`comment_status`,
`ping_status`,
`post_password`,
`post_name`,
`to_ping`,
`pinged`,
`post_modified`,
`post_modified_gmt`,
`post_content_filtered`,
`post_parent`,
`guid`,
`menu_order`,
`post_type`,
`post_mime_type`,
`comment_count`
)
SELECT
'1',
create_date,
create_date,
news_data,
news_title,
summary,
'publish',
'open',
'open',
'',
news_title,
'',
'',
create_date,
create_date,
'',
'0',
'',
'0',
'post',
'',
'0'
FROM `cms_module_news` ;
-- articles
INSERT INTO `wp_posts` (
`post_author`,
`post_date`,
`post_date_gmt`,
`post_content`,
`post_title`,
`post_excerpt`,
`post_status`,
`comment_status`,
`ping_status`,
`post_password`,
`post_name`,
`to_ping`,
`pinged`,
`post_modified`,
`post_modified_gmt`,
`post_content_filtered`,
`post_parent`,
`guid`,
`menu_order`,
`post_type`,
`post_mime_type`,
`comment_count`
)
SELECT
'1',
cms_content.create_date,
cms_content.create_date,
content,
content_name_en,
'',
'publish',
'open',
'open',
'',
content_name,
'',
'',
cms_content.create_date,
cms_content.create_date,
'',
'0',
'',
'0',
'page',
'',
'0'
FROM `cms_content` inner join cms_content_props
ON cms_content.content_id = cms_content_props.content_id
WHERE prop_name = 'content_en';
update `wp_posts` set `post_name` = `ID`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment