Design

Category: Tutorials|Aug 20, 2018 | Author: Admin

how to migrate cmsms news + comments to cgblog

Share on

Thanks to Gregor for the original tutorial, found on the cmsms forum.

I've been using the combination news + comments as a sort of blog module. Because of the existence of CGBlog, I wanted to migrate my data to cgblog. In the following part, I'll show/explain what I have done. 

Thanks to Gregor for the original tutorial, found on the cmsms forum.

I've been using the combination news + comments as a sort of blog module. Because of the existence of CGBlog, I wanted to migrate my data to cgblog. In the following part, I'll show/explain what I have done. 

The basis is to keep the numbering of news articles equal to cgblog articles. This because it helps you to 'link' comments being made to the blog article.

0. Create a backup of the database and store it in a safe place!!!!
1. Install CGBlog
2. Insert News-items into CGBlog. Replace 'Your Name' with the writer of the article. In this case, all articles are written by me. If you have more writers, you have to add these names manually.

insert into cms_module_cgblog
(`cgblog_id`, `cgblog_title`, `cgblog_data`, `cgblog_date`, `summary`, `start_time`, `end_time`, `status`, `create_date`, `modified_date`, `cgblog_extra`, `url`)
select
`news_id`, `news_title`, `news_data`, `news_date`, `summary`, `start_time`, `end_time`, `status`, `create_date`, `modified_date`, `news_extra`, NULL
from cms_module_news

3. First, delete all rows from the cgblog_category table, so you have an empty table. Manual action.
4. Insert the news categories into the cgblog categories:

insert into cms_module_cgblog_categories
(`id`, `name`, `parent_id`, `hierarchy`, `long_name`)
select
`news_category_id`, `news_category_name`, `parent_id`, `hierarchy`, `long_name`
from cms_module_news_categories

5. Insert the relation between the blog categories and the news categories:

insert into cms_module_cgblog_blog_categories
(`blog_id`, `category_id`)
select
`news_id`, `news_category_id`
from cms_module_news

6. If you have made any field definitions in News, insert these into field defs. from the cgblog module:

insert into cms_module_cgblog_fielddefs
(`id`, `name`, `type`, `create_date`, `modified_date`, `item_order`, `public`, `attrs`)
select
`id`, `name`, `type`, `create_date`, `modified_date`, `item_order`, `public`, `extra`
from cms_module_news_fielddefs

7. Insert the field values, if any:

insert into cms_module_cgblog_fieldvals
(`cgblog_id`, `fielddef_id`, `value`, `create_date`, `modified_date`)
select
`news_id`, `fielddef_id`, `value`, `create_date`, `modified_date`
from cms_module_news_fieldvals

8. Make sure you add the correct sequent number:

insert into cms_module_cgblog_seq
(`id`)
select
`id`
from cms_module_news_seq

9. Change the author collum for every post, to your desired username. (new usernames won't be like this unless you manually change it)

UPDATE cms_module_cgblog
SET author = 'Admin'

Sometimes you need to update the "cms_module_cgblog_seq", as it will be showing the wrong number when making a new cgblog news.

You need to export the cms_module_cgblog_seq and edit the number, then delete the existing table, then import the working number version.

[Note, this tutorial is not complete, you may comment or send us an e-mail if you have updates. [email protected]]

Sponsored Ads:

Comments:

Sponsored Ads:

Discord

Page 1 of 1007  >  >>

Microsoft announces new security services and features for AI deployments

news/id3023/1491058772_microsoft-logo-04_story.jpg 1491058772_microsoft-logo-04_story.jpg

May 6, 2024 | Category: Microsoft | Comments

Late last week, Microsoft announced that after a series of high-profile data breaches that involved its services, it had decided it would now be "making security our top priority at Microsoft, above all else." Today, as part of the annual RSA Conference in San Fransisco, the company announced a number of new initiatives designed to boost security for business and enterprise users.

read more…

Can force Facebook to allow it

news/id3022/shutterstock_1975924769-1155x770.png shutterstock_1975924769-1155x770.png

May 5, 2024 | Category: IT | Comments

"Unfollow Everything" is a correct description of the app/script Louis Barclay created for Facebook users.

read more…

Siri can no longer tell the clock

news/id3021/Screenshot-2024-05-02-at-20-26-00-1155x770.png Screenshot-2024-05-02-at-20-26-00-1155x770.png

May 4, 2024 | Category: Apple | Comments

Siri is not the best service from Apple, to put it mildly, but this time it has gone too far.

read more…

Page 1 of 1007  >  >>