I followed a old suggestion from this list and use PHPmyadmin to import
CSV's works well. 

Barry Keyles



-----Original Message-----
From: Mike Dent [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 29, 2007 6:35 AM
To: User questions and discussions about OTRS.org
Subject: Re: [otrs] Import customers from cvs?

On 9/29/07, Hannes Riechmann <[EMAIL PROTECTED]> wrote:
> Hello,
>
> is it possible to import customers from a cvs file? I thought about
> adapting the otrs.addUser script, so that it can add customer and then
> calling my script for every entry in my cvs file. Anybody knows a better
> solution?
>
> Thank in advance
>
> Hannes

Hi,
I went through this when moving from RT to OTRS, here is the email I
sent back to the list with how I did it, hope it helps.

Mike



mysql> load data infile '/tmp/otrs_test.txt' into table customer_user
fields terminated by '\t' lines terminated by '\r' (first_name,
last_name, address, postcode, phone1, email, customer_id, valid_id,
create_time, create_by, change_time, change_by, login);

Query OK, 195 rows affected (0.03 sec)
Records: 195  Deleted: 0  Skipped: 0  Warnings: 0

This was after I created some extra fields in the mysql table with:-

mysql> alter table customer_user add address varchar (250);
Query OK, 1 row affected (0.46 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql> alter table customer_user add postcode varchar (250);
Query OK, 1 row affected (0.19 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql> alter table customer_user add phone1 varchar (250);
Query OK, 1 row affected (0.20 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql> alter table customer_user add phone2 varchar (250);
Query OK, 1 row affected (0.20 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql> alter table customer_user add os varchar (250);
Query OK, 1 row affected (0.20 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql> alter table customer_user add broadband varchar (250);
Query OK, 1 row affected (0.44 sec)
Records: 1  Duplicates: 0  Warnings: 0

Another thing which got me was the end of line difference in unix and
PC! when importing the data to the table above I originally was using
'\n', eventually I figured I should be using '\r' !
Even though I was working on a Mac with Excel.

So finally all my records are imported and I'm slowly getting to grips with
it!






> _______________________________________________
> OTRS mailing list: otrs - Webpage: http://otrs.org/
> Archive: http://lists.otrs.org/pipermail/otrs
> To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
> Support or consulting for your OTRS system?
> => http://www.otrs.com/
>


_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support or consulting for your OTRS system?
=> http://www.otrs.com/

Reply via email to