Solved

K2 Items to Joomla Articles

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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