Solved

K2 Items to Joomla Articles

Posted on 2013-05-28
5
2,433 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 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 SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sort in mysql based off of query param 4 35
MySQL 5.6.30 - daily outages 46 86
Uploading a CSV Data Import via PHP & MySql 3 70
Duplicated data in GROUP_CONCAT 2 50
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Creating and Managing Databases with phpMyAdmin in cPanel.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

737 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