?
Solved

K2 Items to Joomla Articles

Posted on 2013-05-28
5
Medium Priority
?
2,470 Views
Last Modified: 2013-05-30
Hi!

I'm building a client a new website. The old site used K2 for certain content. On the new instance, I'm making a clean break from K2, but I have about 300 k2_items records I'd like to migrate back to Joomla articles. I read an article that showed the following syntax to do what I'm after, but I keep getting syntax errors around the fulltext, both with and without single quotes. Can anyone tell me what is wrong with this query?

insert into srp_final.jos_content (title, alias, introtext, fulltext, state, sectionid, catid, created_by, metakey, metadesc, ordering) select title, alias, introtext, fulltext, 'published', '17', catid, '841', metakey, metadesc, ordering from selene2_srporg.jos_k2_items

Please note these are two separate databases, but they're on the same machine and MySQL instance. Any suggestions? Or does anyone know a clean way to accomplish this?

Thank you.

Bill
0
Comment
Question by:billium99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 1

Author Comment

by:billium99
ID: 39202568
BTW - the 17 is my new article category and the 841 is the new user ID for the created_by value.

Thanks
0
 
LVL 12

Expert Comment

by:duttcom
ID: 39203159
You could try the code you already have to convert the K2 items in your old database to Joomla articles in the same database, to eliminate any potential problems caused by copying from elsewhere, and then export the newly created Joomla articles as an SQL file. Then you only need to do a search and replace on the SQL file in a text editor and replace the old table names with the new ones. Then you can run the SQL file in the new database to bring in the articles.

There is also a reasonably priced commercial solution to this problem - http://www.cms2cms.com/supported-cms/joomla-k2-to-joomla-migration
0
 
LVL 1

Author Comment

by:billium99
ID: 39204324
Hello - first I'm asking what is wrong with the syntax of my SQL query. I'm not getting a syntax error on database names. I'm getting a syntax error on "fulltext". Why? Does anyone see a problem with my SQL query? Here it is again.

insert into srp_final.jos_content (title, alias, introtext, fulltext, state, sectionid, catid, created_by, metakey, metadesc, ordering) select title, alias, introtext, fulltext, 'published', '17', catid, '841', metakey, metadesc, ordering from selene2_srporg.jos_k2_items

Thanks

Bill
0
 
LVL 12

Accepted Solution

by:
duttcom earned 2000 total points
ID: 39206363
Hi Bill, I think the problem may not be the fulltext field, but the published one in your select statement. The single quotes are trying to insert the word published into the state field, which is expecting an integer.

Try removing the single quotes from the published field name in the select query.
0
 
LVL 1

Author Closing Comment

by:billium99
ID: 39209497
Thanks for the help!
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating and Managing Databases with phpMyAdmin in cPanel.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question