143 Posts
pretobrazza
10 years ago
Topic
Message Successfully Imported. 5182 item(s) created, 0 item(s) updated, 0 item(s) cancelled. ( Log )

Hi, I got it right!

But one HAS to respect the rules!!

This import worked for about 4 hours to finally give me the message above: SUCCESS! (5182 rows with 11 fields + the ones automatically filled in by Joomla 3.2.1 (ID, user, published, date/time, etc)).

While the files were being imported, I had no shame of continuing to work on the make up of the 'List & Search Type' of the content type which was being imported,
When refreshing the results of the List & Search on the front end, I saw the content grow as I was working on. ;)

For those who never used this amazing feature of Seblod, there are a few basic rules to respect:
1) ALWAYS export to fields marked as -TEXT-fields (you can set the limit to anything higher than 255 if need be).
2) Each name in the first row of your .cvs field must be an EXACT replica of the field in the different tables of your database you want to write to.
3) Make SURE there's NO trailing space behind the name of each field on the first row of your .cvs file. Otherwise the import will write that field to another column in another table in the database with a '_' behind it.
4) There was no need anymore like in the previous version of importer to put an 'ID' column as the latest version of Importer automatically starts writing the new records under the last record in the #_content table.

Note: If you have no experience: Import a replica of you .cvs file with only 2 rows. It should produce 1 article in the category you wrote to.
If you are satisfied of the result, then trash the article, view the trashed files, trash it again and import the full .cvs file.

Mehdi, since the first version of Importer, you did a tremendous job improving it. Congratulations! I wanted to post the message in the reviews section of the products page but there was a limit of 255 only characters ..

Kind regards, Bernard - Best wishes for 2014!!

(ps. The instructions for importer 1.3.0 (HOW TO SETUP THIS ADD-ON ?) at the bottom of: administrator>Components>Seblod 3.X> Importer, urgently need to be updated)
Get a Book for SEBLOD
152 Posts
pixelpixel
10 years ago
1
Level 1
Thx a lot for this hint Bernard. Thumbs up! :)
10 years ago
0
Level 2
Hi Bernard,
Thanks a lot!
We increased textarea size on product comment http://www.seblod.com/products/7
Regards.
10 years ago
0
Level 1
Hi
I don't really understand the documentation does the exporter (30€) and importer (Free ) support all object type and instance of that object ( content type ) create ( from scracth extends) by using seblod , joomla core , third company ( JEvent object type ) ?
regard's
10 years ago
3
Level 1

I am very envious of your perfect import. 

I have been struggling for nearly 4 days with a 1700 record import. For some reason, I keep on getting

1062 Duplicate entry '123' for key 'PRIMARY' SQL=INSERT INTO `#___content` (I removed true id and table prefix for this post)

I don't understand what I am doing wrong. My CSV is exported from Open Office and I am using ; as delimeter and " for text fields. 

There are no duplicates, in the same fields, not even the titles.

the records I am importing does have text fields, but also catid, id, userid and the standard #__content table's columns. I have about 200 records to go, but keep on getting this error on import and then it only adds one or two or three records at a time. At this rate, I am going to work through the night a third time this week! 

I have some images I rewrote into sebloid :: format, but because it's in custom mode and my import is done in standard mode, I am going to import the image column only when all listings are in.

Because I am inserting the id, I am selecting NO with reorder. I don't even know what this does, but previously found it broke the import. Also, I attempted to use the ajax, but it simply logs me out of Joomla everytime I run the importer. 

In any case, I hope there's somebody that can shed some light on this for me. I am growing very fond of SEBLOD but I feel those extensions we pay for should at least have better documentation and maybe something that can help us with debugging eg. to dump a list of all queries and errors somewhere etc. or report on every record that's imported. 

Greetings

143 Posts
pretobrazza
10 years ago
2
Level 2

Hi Kalemanzi,

I remember one initial mistake I made : after a 'test run', I deleted the few articles I tested. Deleting those is not enough though. One also has to trash them. Did you do so?

Bernard 

Ps. Why do you insert ID?

=> 4) There was no need anymore like in the previous version of importer to put an 'ID' column as the latest version of Importer automatically starts writing the new records under the last record in the #_content table.

10 years ago
0
Level 3

yep. got that base covered.

The one thing that worries me is that it says we must only import to text, but what about fields are already defined as int?

10 years ago
0
Level 3

Re the id. The old system I migrated from, assigned a certain joomla id to the listings, so I am importing the records to identical ids, but to seblod. This is so I can catch Google indexed urls. Previous system was non sef, so it's easy to tage the GET variables and pipe them to a component that can redirect the correct id to the correct listing. In retrospect. I could have just called it old_id and imported it leaving id to auto increment and then use it as a lookup table to redirect old ids to the correct one

10 years ago
0
Level 1

Pardon me if I monologue a bit. I have now noticed a pattern. 

If I try to add a new article, Joomla attempts to assign a new id, but I already imported a record to that id. It fails when I press save. Then, it keeps on failing, till it finds an unoccupied id. Some of the ids have gaps in them eg the client deleted records so the increment would be 9, 10, 12, 13 instead of 9,10,11,12,13 etc. 

I wish there is a way to tell joomla / mysql to only auto imcrement after a certain value eg. the value of last imported listing id. Creating a listing and changing the id in mysql also does not work, because when I create a new article, it just keeps on counting where it left off. If the slot is open the article is created, and if it's not it returns an error, but does not go for the next available id. 

Maybe my struggle can help somebody else?

10 years ago
1
Level 1

Finally! I solved it. The problem was with auto increment of the ID. I just set the auto increment to a number greater than the number of my last import id and it solved everything.

ALTER TABLE `prefix_content` AUTO_INCREMENT = 12345 where 12345 is a number greater than what the last id is in my CSV file. 

On the question as to why use an id field, it's also for the csv importer to know where to save what if you are importing empty rows. Not all fields are filled in in every record, so the id is the only way to point where what must be written to.

A sigh of relief!

143 Posts
pretobrazza
10 years ago
0
Level 2

I'm glad you solved it Kalemanzi!

10 years ago
4
Level 1

Be carefull!!! there is a limit of 1000 char per rows in your CSV file. Otherwise, your import will be broken and messy.
You can correct this limitation by reading this topic : 

http://www.seblod.com/community/forums/fields-plug-ins/restriction-with-importer#post19456

I was going crazy with this limitation. Thank you Seblod comunity and seblod for his very usefull plugin

10 years ago
3
Level 2

Hi netoale,

The add-on "importer" has no limitation if you select mode "ajax" in its configuration.

Regards,
Mehdi

10 years ago
0
Level 3

Hi Mehdi and thank you for your answer.

I didn't find where to configure "ajax" mode. Anyway, I think that "ajax" mode is useful for big files with many, many rows. In my case, the problem can occur with only two rows, but with long rows (more than 1000 char). So when you import file with a little long text description, import is totally messed up . Are you sure that option "ajax" switch off this limitation.

Thank you.

572 Posts
_jrmo
10 years ago
1
Level 3

Hi all,

Just in follow up to Mehdi's comment - there are still SOME limitations to the importer, even in AJAX mode. I have run tests with a csv with 50 columns and it struggles to import it properly. In this instance I would:

  1. split the csv in to at least 2 separate csv's - with half the columns in one, and half in the other.
  2. import the first csv
  3. get the id's of the content from the article manager
  4. create a new column in your second csv called 'id' with the proper id's allocated to each row
  5. use the import again on the second sheet. Since you have the id column now it will 'update' the existing content with the new column information.

If you still have problems after dividing your file in half, try doing it in thirds or fourths, adding the 'id' column for every csv file after the first one.

_jrmo

10 years ago
0
Level 4

Thank _jrmo for your solution without hack. But the problem can happen with only one column : If you have a description text of more than 1000 chars. So I think it's simpliest to hack the code as explained here :

http://www.seblod.com/community/forums/fields-plug-ins/restriction-with-importer#post19456

4229 Posts
Kadministrator
10 years ago
2
Level 1

Hi all,

with the new Seblod 3.5. release there was also an update to the improter tool, CVS line character limit has been made configurable, there is a parameter (Options) when the user can specify the length/limit…. 0 for unlimited number of character per line.

10 years ago
0
Level 3

Hi all

I can't use the seblod importer to fill seblod contents with fieldX and groupX.

Maybe there is something I miss but I don't find how to tell the importer to fill complex fields such as fieldX/GroupX.

For example with resumes, you generally have several job experiences and training/school items. Such items are defined with groupX in the seblod resume. We have CSV files of the resumes but even if the CSV file has each job experience in a separate column (and for each of them separate sub colums), I don't know how we can dispatch each job in each field of the groupX.

FOr instance each job experience could be defined by:

* name of the company you worked in

* start and end dates

* name of your position in this company

* description of what you did there

In the CSV file we could have (if we limit the number of jobs to 3):

company_name1; start_date1;end_date1;position1;description1; company_name2 start_date2;end_date2;position2;description2;company_name3; start_date3;end_date3;position3;description3;

but in the seblod RESUME content type we could have one groupX 'job exeperience' with sub fields (company_name; start_date;end_date;position;description;)

Shold we write our own PHP routine to import such contents or can the seblod importer do the job please?

thanks

cyril

9 years ago
0
Level 1

One other issue that one should be aware of. Each row must finish with CR/LF (unix EOL) a simple CR (^M) is not enough! vi is your friend!

Get a Book for SEBLOD