Keyword

Tool for importing / exporting items to / from K2

  • Individual IT
  • Individual IT's Avatar Topic Author
  • Offline
  • Elite Member
  • Developer of the K2 Import / Export Tool
More
8 years 8 months ago #58880 by Individual IT
Replied by Individual IT on topic Re: Tool for importing / exporting items to / from K2
Hi Gabriel Hernández,
both files are not encoded UTF-8, what should not be a big problem as long there are encoded the same way as your database and website.
The real problem is that the files do not have quatation marks on the correct places. It looks for me that you have edited the first file after exporting it and the second has no quatation marks at all. This can work but no guatrantee for it.
each column must be separated by ","
text-fields must be enclosed within double-quote characters => "

check the example CSV file www.individual-it.net/images/stories/com_k2import/example_new.csv
and the instructions: www.individual-it.net/en/Instructions-for-K2-Import-Component.html

Please compare the example CSV with your file using a simple text editor.
In my experiences LibreOffice handles CSV files much better than Excel. There you have also the posibility to say how the columns have to be separated end enclosed.

Hope That Helps

Please Log in or Create an account to join the conversation.

  • Individual IT
  • Individual IT's Avatar Topic Author
  • Offline
  • Elite Member
  • Developer of the K2 Import / Export Tool
More
8 years 8 months ago #58881 by Individual IT
Replied by Individual IT on topic Re: Tool for importing / exporting items to / from K2
Hi Bob,
what version of Joomla, K2 and the extension are you using?

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #58882 by Bob Weaver
Thank you for your reply.
Joomla 3.3.0
K2 2.6.8
K2fields 2.0.0
K2 Import 2.0 rc1
I would like to know the exact format for importing multiple options.
Thanks for your help!

Please Log in or Create an account to join the conversation.

  • Gabriel Hernandez Garcia
  • Gabriel Hernandez Garcia's Avatar
  • Offline
  • New Member
More
8 years 8 months ago #58883 by Gabriel Hernandez Garcia
Replied by Gabriel Hernandez Garcia on topic Re: Tool for importing / exporting items to / from K2

Individual IT wrote: Hi Gabriel Hernández,
both files are not encoded UTF-8, what should not be a big problem as long there are encoded the same way as your database and website.
The real problem is that the files do not have quatation marks on the correct places. It looks for me that you have edited the first file after exporting it and the second has no quatation marks at all. This can work but no guatrantee for it.
each column must be separated by ","
text-fields must be enclosed within double-quote characters => "

check the example CSV file www.individual-it.net/images/stories/com_k2import/example_new.csv
and the instructions: www.individual-it.net/en/Instructions-for-K2-Import-Component.html

Please compare the example CSV with your file using a simple text editor.
In my experiences LibreOffice handles CSV files much better than Excel. There you have also the posibility to say how the columns have to be separated end enclosed.

Hope That Helps


The problem maybe is if my csv file came from another database (not k2) to be specific from sobipro and they export application doesn't give the option to encode and about the quantation marks i just have the option of the data Separator and multi-values separator.

So i think will be impossible use that database with your plugin, at least i don't know how to do it.
:( :(

Please Log in or Create an account to join the conversation.

  • Individual IT
  • Individual IT's Avatar Topic Author
  • Offline
  • Elite Member
  • Developer of the K2 Import / Export Tool
More
8 years 8 months ago #58884 by Individual IT
Replied by Individual IT on topic Re: Tool for importing / exporting items to / from K2
Hi Bob,
this looks to me like an change in K2 to that I will have to addapt the software. This might take a while as I'm on a training at the moment.

Please Log in or Create an account to join the conversation.

  • Individual IT
  • Individual IT's Avatar Topic Author
  • Offline
  • Elite Member
  • Developer of the K2 Import / Export Tool
More
8 years 8 months ago #58885 by Individual IT
Replied by Individual IT on topic Re: Tool for importing / exporting items to / from K2
Hi Bob.
I've just double checked with exactly the same software you are using and it is working for me. So its not a change in K2
In the CSV the values should be noted as you write you have done it.
The values in the database should be at the end: {"id":"2","value":["1","2"]}] so the IDs of the group and the values
"969=:=:=","1189=:=:=", looks strange

Did you assign the extra field group to the category you are trying to import into?

Can you please check for me what is the content in the table *k2_extra_fields for the fields you are trying to import and also how the fields are saved in the DB when you create the item by K2.

Please Log in or Create an account to join the conversation.

  • Individual IT
  • Individual IT's Avatar Topic Author
  • Offline
  • Elite Member
  • Developer of the K2 Import / Export Tool
More
8 years 8 months ago #58886 by Individual IT
Replied by Individual IT on topic Re: Tool for importing / exporting items to / from K2
If the export does not give an option to convert to UTF8 you can try to import as it is or try to convert it with an external tool (like libreoffice) or convert to UTF8 during import, there is an option for that.

Your first problem is the separator and the encloser. to change that do:
1. Download and Install LibreOffice
2. Open the CSV with LibreOffice
3. check the values are correct
4. Go to File-Save As
5. Select folder and file name
6. select Text-CSV as format
7. check the "Edit filter Settings" box
8. click "Save"
9. select , as field delimiter and " as text-delimiter
10. click OK
11. open the saved file with a text editor and double check it
12. try to import the file

BEFORE EVEN TRYING TO IMPORT MAKE A FULL BACKUP OF YOUR DATABASE AND JOOMLA FILES

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago - 8 years 8 months ago #58887 by Bob Weaver
Thank you for your reply. Yes, I did assign the extra fields group to the category. I am attaching to this reply 3 screen shots, one of the table k2_extra_fields, one of k2_extra_fields_values and one of k2_extra_fields_list_values, so you can see what the database tables look like. I am also attaching a CSV file which was producted by the Export command of the K2 Import/Export component.

What I am confused about, is the exact format I need to have the CSV file in for import. With the extra fields, which can contain multiple options, should I be importing option names, such as:
"Gold,Teal,Purple"
or with spaces:
"Gold, Teal, Purple"
or with IDs:
"1535,1539,1542"
or:
"1535, 1539, 1542"
or
"1535:1539:1542"

Which is the proper format?
If necessary I can give you administrator access to look at the component or even cpanel access to look at the database and send you the login information by email.
Thank you for your help.
Attachments:

Please Log in or Create an account to join the conversation.

  • Individual IT
  • Individual IT's Avatar Topic Author
  • Offline
  • Elite Member
  • Developer of the K2 Import / Export Tool
More
8 years 8 months ago #58888 by Individual IT
Replied by Individual IT on topic Re: Tool for importing / exporting items to / from K2
Hi the format "Gold,Teal,Purple" should be fine.
Thank you for the screen-shots. But the items I can see in k2_extra_fields are all of the type textfield and before you were talking about multi select fields
And I see that you have extra tables that I don't have. That might be because of the k2fields extension. If this extension changes the database structure my tool will not be able to export/import correctly.

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #58889 by Coptechs
Will this work to migrate K2 Items, Categories, etc. from a 2.5 site to a 3.3 site? Or does it only work within a particular version of Joomla?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum