Solved

K2 Items to Joomla Articles

Posted on 2013-05-28
5
2,046 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
  • 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 500 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now