- Posts: 15
COMMUNITY FORUM
how to convert k2 items to default joomla articles
- Marco Elric
-
Topic Author
- Offline
- New Member
:(
Please Log in or Create an account to join the conversation.
- Marco Elric
-
Topic Author
- Offline
- New Member
- Posts: 15
we don't need k2 in joomla 1.6 we are all aware of that.
Solutions Expert said:two tabs in firefox.. old stuff in k2 and other tab where you are copying stuff too...lolzzzz they will never make this option (i already have said this a thousand times here... with zero response)---1 out of 20 reasons i moved on to resources.
just did this... myself
Please Log in or Create an account to join the conversation.
- recipe cook
-
- Offline
- New Member
- Posts: 2
1. back up everything2. move users from k2 to joomla3. transfer all the table data from k2 to joomla and confirm it.Run the following queries in phpmyadmin
For transferring contents:-
insert into jos_content (title, alias, introtext, state, sectionid, catid, created_by, metakey, metadesc, ordering) select title, alias, introtext, published, '2', catid, '69', metakey, metadesc, ordering into jos_k2_items
here 2 represents section id of joomla and 69 represents admin id.
For transferring categories:-
insert into jos_categories (title, alias, published, ordering, section) select name, alias, published, ordering, '2' from jos_k2_categories
Here 2 represents section id
After confirming the data remove k2 componenthttp://recipe2cook.com
Please Log in or Create an account to join the conversation.
- Samuel Carbo III
-
- Offline
- Junior Member
- Posts: 37
Please Log in or Create an account to join the conversation.
- Samuel Carbo III
-
- Offline
- Junior Member
- Posts: 37
First and probably most importantly right this minute is, your code... should be changed from....
insert into jos_content (title, alias, introtext, state, sectionid, catid, created_by, metakey, metadesc, ordering) select title, alias, introtext, published, '2', catid, '69', metakey, metadesc, ordering into jos_k2_items
to...
insert into jos_content (title, alias, introtext, state, sectionid, catid, created_by, metakey, metadesc, ordering) select title, alias, introtext, published, '2', catid, '69', metakey, metadesc, ordering from jos_k2_items
Once the code is changed following your directions are simple.
Next, I would like to make some minor adjustments however I keep getting errors, I would like to have 'Hits' as well as 'created' added to this query, I am really hoping this is possible, as I think after two years you may have just made me what is possibly the happiest guy on the internets right now.
Please Log in or Create an account to join the conversation.
- Samuel Carbo III
-
- Offline
- Junior Member
- Posts: 37
Please Log in or Create an account to join the conversation.
- Macrohard
-
- Offline
- New Member
- Posts: 12
Samm Carbo said:
Nevermind I figured it out! Very exciting!
Please Log in or Create an account to join the conversation.
- Macrohard
-
- Offline
- New Member
- Posts: 12
insert into jos_content (title, alias, introtext, `fulltext`, state, sectionid, catid, created_by, metakey, metadesc, ordering) select title, alias, introtext, `fulltext`, published, '2', catid, '69', metakey, metadesc, ordering from jos_k2_items
Please Log in or Create an account to join the conversation.
- Macrohard
-
- Offline
- New Member
- Posts: 12
Jason Knight said:
Had to add it in like:
insert into jos_content (title, alias, introtext, `fulltext`, state, sectionid, catid, created_by, metakey, metadesc, ordering) select title, alias, introtext, `fulltext`, published, '2', catid, '69', metakey, metadesc, ordering from jos_k2_items
Please Log in or Create an account to join the conversation.
- Andrew Gaskell
-
- Offline
- New Member
- Posts: 6
Just a quick one, I found the best query for categories was...
insert into vh4z6_categories (title, alias, description, parent_id, published, access, extension, language) select name, alias, description, parent, published, access, 'com_content', '*' from vh4z6_k2_categories
Where "vh4z6" is your table prefix
Please Log in or Create an account to join the conversation.
- Davor
-
- Offline
- New Member
- Posts: 9
so I'm using j3.1.5 and I want to move K2 items to joomla content
I'm unsuccessfully using this sql query command but no luck, what am I doing wrong?
insert into `ZZZ_content` (id, title, alias, catid, introtext, fulltext, created, created_by, created_by_alias, checked_out, checked_out_time, modified, modified_by, publish_up, publish_down, access, featured, hits, language) select id, title, alias, catid, introtext, fulltext, created, created_by, created_by_alias, checked_out, checked_out_time, modified, modified_by, publish_up, publish_down, access, featured, hits, language from `ZZZ_k2_items`
- where ZZZ is prefix
- error I get: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fulltext, created, created_by, created_by_alias, checked_out, checked_out_time, ' at line 1
Please Log in or Create an account to join the conversation.
- Davor
-
- Offline
- New Member
- Posts: 9
INSERT INTO `yourDBname`.`prefix_content` (`id`, `title`, `alias`, `catid`, `introtext`, `fulltext`, `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `access`, `featured`, `hits`, `language`)
SELECT `id`, `title`, `alias`, `catid`, `introtext`, `fulltext`, `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `access`, `featured`, `hits`, `language`
FROM `yourDBname`.`prefix_k2_items`
Please Log in or Create an account to join the conversation.
- Davor
-
- Offline
- New Member
- Posts: 9
Please Log in or Create an account to join the conversation.
- karlo
-
- Offline
- New Member
- Posts: 15
Please Log in or Create an account to join the conversation.
- Davor
-
- Offline
- New Member
- Posts: 9
1. Found out URL of K2 images, e.g. /media/k2/items/cache/319a6b58175c8348e5b537a311344d30_S.jpg
2. Put any image into Joomla article to see structure in database. And I saw the structure is like this:
{"image_intro":"images\/some_folder\/e0a70f72bdae9885bfc32d7cd19a26a1_S.jpg","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
Notice that link is images \ / some_folder \ / (without empty spaces, so backslash and slash)
3. Copied all images from old website from old folder /media/k2/items/cache/ to my new website and new folder /images/some_folder/
4. I than open xxx_content (where xxx is db prefix) table in my database and put that code from #2 inside all articles (450) but without url of image, so I put it like this:
{"image_intro":"images\/some_folder\/_S.jpg","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
Notice that there isn't url of image, structure is images \ / some_folder \ / _S.jpg
5. And than I opened 2 tabs (or explorer windows) and
a) opened first K2 item, copy url
b) opened database of new website and paste name of that picture inside xxx_content, not the whole url, just the image name (if url is /media/k2/items/cache/319a6b58175c8348e5b537a311344d30_S.jpg I copied just 319a6b58175c8348e5b537a311344d30 without _S.jpg and rest of the url) along with images field structure in #4
c) and now inside database the whole structure of images field of that first article is:
{"image_intro":"images\/some_folder\/319a6b58175c8348e5b537a311344d30_S.jpg","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
6. Again paste that structure in images filed in database of new website and copy-paste image name in url.
It's a bit complicated but it will took you just 30 sec when you know what are you doing. Do this or let cms2cms do this for you for 200-300 $ (price depends on how many articles you have). OR when you have all your articles migrated from K2 to joomla, using method I posted above, you can open every article and upload image. You see how this will be hard to do? It's simpler to follow my steps
Please Log in or Create an account to join the conversation.
- karlo
-
- Offline
- New Member
- Posts: 15
I'll try what you offer. I think I understand. I moved articles, categories and tags using MYSQL. I could only picture and synchronizing tags with articles.
That's how I moved tags, but I changed the table structure jos_k2_tags
TAGS
INSERT INTO `DBNAME_news`.`jos_tags` (`id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `published`, `access`, `language`)
SELECT `id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `published`, `access`, `language`
FROM `DBNAME_news`.`jos_k2_tags`
Please Log in or Create an account to join the conversation.
- Flavia Silveira
-
- Offline
- Junior Member
Thank you in advance,
Flavia
Flavia
Geek. Author. Role Player.
Please Log in or Create an account to join the conversation.
- karlo
-
- Offline
- New Member
- Posts: 15
I advise if items are few, transfer them manually
I hope you understand?
CATEGORIES
INSERT INTO `DATABASENAME_PREFIX`.`PREFIX_categories` (`id`, `title`, `alias`, `published`, `access`, `parent_id`, `language`, `extension`, `level`, `path`, `params`, `asset_id`)
SELECT `id`, `title`, `alias`, `published`, `access`, `parent_id`, `language`, `extension`, `level`, `path`, `params`, `asset_id`
FROM `DATABASENAME_PREFIX`.`PREFIX_k2_categories`
Articles
INSERT INTO `DATABASENAME_PREFIX`.`PREFIX_content` (`id`, `title`, `alias`, `catid`, `introtext`, `fulltext`, `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `access`, `featured`, `hits`, `language`)
SELECT `id`, `title`, `alias`, `catid`, `introtext`, `fulltext`, `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `access`, `featured`, `hits`, `language`
FROM `DATABASENAME_PREFIX`.`PREFIX_k2_items`
TAGS
INSERT INTO `DATABASENAME_PREFIX`.PREFIX_tags` (`id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `published`, `access`, `language`)
SELECT `id`, `parent_id`, `lft`, `rgt`, `level`, `path`, `title`, `alias`, `published`, `access`, `language`
FROM `DATABASENAME_PREFIX`.`PREFIX_k2_tags`
Please Log in or Create an account to join the conversation.
- Andreas A
-
- Offline
- New Member
- Posts: 3
I managed to move my K2 items succefully, with no intro image though.
Davor, I tried to understand your steps, and I'm not sure I did. It is still a manual task that has to be done in each article seperately, right?
I was wondering if it could be done with a query or something. But looking into the k2 items db, I wasn't able to see anything relevant to the intro image. I found cells about everything else, but not for the main item image. Should I be looking somewhere else?
Davor wrote: I don't know about tags, I didn't move them but I moved images this way:
Please Log in or Create an account to join the conversation.
- thongtran
-
- Offline
- New Member
- CEO at foobla.com
However, sometimes people need to convert back to Joomla articles because of template stuff or something.
In that case, you can use one click solution by foobla > K2 to Joomla Articles converter , it works the same way K2 import items from Joomla Content.
Please Log in or Create an account to join the conversation.