Mass Import Of Customers

Moderator: crythias

Post Reply
Commander Pete
Znuny newbie
Posts: 1
Joined: 01 Nov 2011, 23:19
Znuny Version: 3.0
Real Name: Pete
Company: Aerus Technologies

Mass Import Of Customers

Post by Commander Pete »

Hi
I am quite new to this
I have installed the Windows edition onto our server and started the configuration process, However; One thing i can not seem to work out how to do is import a Customer file (CSV Format)
We have an existing system and I want to port our Customer base into OTRS
Any suggestions ?
:(
SilentGreen
Znuny newbie
Posts: 2
Joined: 07 Dec 2011, 15:12
Znuny Version: 3.1.7
Real Name: Holger Groenert
Company: Sidmar AG

Re: Mass Import Of Customers

Post by SilentGreen »

Hi

I'm new too, and i have the same issue here.
We are using another application as CRM with a MySQL-DB.
The only way to get the customers addresses is to export these as an .csv-file but i found no way to import these to the OTRS-System.

I am running the Windows-version on my local computer to test OTRS.

Thanks for any help.

Greetz
SilentGreen
Testing: OTRS 3.1.7; ITSM: 3.1.4
System: Windows Server 2008 R2 Enterprise x86-64
DB: MySQL (planing to switch to MSSQL Express 2008 R2 SP2)
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Mass Import Of Customers

Post by crythias »

For existing customer information in another database, the short answer is *don't* import.
No, really. Just use a different backend and interface with it.

http://doc.otrs.org/3.0/en/html/custome ... backend-db

OPTIONAL: I'd suggest making sure (?) that the customer information is read-only on otrs, but if you want otrs to modify, just be aware that it *can* do that, and therefore affects both front-ends (not damage, mind you, but if you change a name or a login on one side, it will affect the other side, for good or bad.)

OPTION 2:
IMPORT TO OTRS database.
WARNING if you're using a different backend than otrs, and the backend is not readonly, this will add customers to the default Customer backend (maybe ldap, maybe to your CRM. Be smart about this!) WARNING

If you want to mass import to OTRS, there is an opt/bin/otrs.AddCustomerUser.pl that can be used:

otrs.AddCustomerUser.pl [-f firstname] [-l lastname] [-p password] [-g groupname] [-e email] username
if you define -g with a valid group name then the user will be added that group


So if you use excel, for instance, you can make a batch by copy/paste into a column: (-g group is optional. If you don't have customergroup support enabled, it's not really relevant)

="bin/otrs.AddCustomerUser.pl -f " & firstnamecell & " -l " & lastnamecell & " -p " & passwordcell & " -e " & emailcell & " " & usernamecell

then you should be able to copy this new column to a command line (in your otrs root, like /opt/otrs) and populate your database.

Please be smart about what you're doing. Backup your database before import. Test a small section before rolling out the whole thing. Make sure it works how you want. Be careful about conflicts of existing usernames. Those cell locations will vary relevant to your data, so if you copy verbatim, it's not going to work correctly until you make appropriate changes.

Standard disclaimer must apply: What I'm suggesting is something that should work based upon what exists in otrs already. I do not suggest you run this twice, though CustomerUserAdd will error with User already exists, if it can detect it. Make sure you know where the data is going to go.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Bev13
Znuny newbie
Posts: 6
Joined: 16 Mar 2012, 16:16
Znuny Version: OTRS3
Real Name: Bev Leng
Company: Churchill China UK Ltd

Re: Mass Import Of Customers

Post by Bev13 »

Hi, I'm setting up OTRS 3 on a Centos Server and trying to import my customer list.
My import file is OTRSCustList.csv and I will admit I'm a beginner at Linux cli.

My import csv has column headers for firstname, lastname, password, email, username.

Can you let me know how I run the otrs.AddCustomerUser.pl command and point it at this csv file? Both are in the otrs/bin location.

Hope you can help me.

Cheers. Bev
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Mass Import Of Customers

Post by crythias »

Read the post above you again.
0) backup otrs database.
1) open your csv in excel
2) add a column

Code: Select all

="bin/otrs.AddCustomerUser.pl -f " & firstnamecell & " -l " & lastnamecell & " -p " & passwordcell & " -e " & emailcell & " " & usernamecell 
3) copy/paste the result column on the /opt/otrs command line.

So, if you don't have these fields, you'll need to add them or use values

Code: Select all

="bin/otrs.AddCustomerUser.pl -f " & firstnamecell & " -l " & lastnamecell & " -p SecretPass -e " & emailcell & " " & usernamecell 
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Bev13
Znuny newbie
Posts: 6
Joined: 16 Mar 2012, 16:16
Znuny Version: OTRS3
Real Name: Bev Leng
Company: Churchill China UK Ltd

Re: Mass Import Of Customers

Post by Bev13 »

Hi, thanks for getting back to me.

I have changed my column names to firstnamecell etc.

When I add a column into my csv, is at at the end of my data? Do I then copy the following command into that column?

="bin/otrs.AddCustomerUser.pl -f " & firstnamecell & " -l " & lastnamecell & " -p " & passwordcell & " -e " & emailcell & " " & usernamecell

I tried that and I get #NAME? as a result.

Could you give me some more information please?

Cheers Bev
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Mass Import Of Customers

Post by crythias »

Bev13 wrote:I have changed my column names to firstnamecell etc.
unnecessary.
Bev13 wrote:When I add a column into my csv, is at at the end of my data?
To the right of your data. start with one row and copy/paste down.
Bev13 wrote: Do I then copy the following command into that column?
Yes, but firstnamecell is the row/column pairing for your current row.
example: ="bin/otrs.AddCustomerUser.pl -f " & A2 & " -l " & B2 & " -p " & E2 & " -e " & C2 & " " & D2

Code: Select all

Bob	 Jones	bobjones@mailinator.com	 bobjones	 Pass111	bin/otrs.AddCustomerUser.pl -f Bob -l Jones -p Pass111 -e bobjones@mailinator.com bobjones
John	Smith	johnsmith@mailinator.com	johnsmith	Pass222	bin/otrs.AddCustomerUser.pl -f John -l Smith -p Pass222 -e johnsmith@mailinator.com johnsmith
(I can't possibly guess your column order. I assumed you'd be able to know this and replace the fields accordingly.)
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Bev13
Znuny newbie
Posts: 6
Joined: 16 Mar 2012, 16:16
Znuny Version: OTRS3
Real Name: Bev Leng
Company: Churchill China UK Ltd

Re: Mass Import Of Customers

Post by Bev13 »

Thanks for the extra info, I have got the column in excel with the command and user data in one column, do I have to copy and paste each result into the opt/otrs cmd line or can I import the sheet to the location and run it to import all the info at once?

Thanks again for your help.

Bev
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Mass Import Of Customers

Post by crythias »

" copy/paste the result column on the /opt/otrs command line."
It means exactly that. Copy that new column. (highlight, ctrl-c or right-click copy or Edit copy or press the copy toolbar button)
open a shell / command prompt where otrs exists.
(optional, but to be sure, do a dir or ls to make sure bin is a folder/directory listed)
Paste the column that you copied.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Bev13
Znuny newbie
Posts: 6
Joined: 16 Mar 2012, 16:16
Znuny Version: OTRS3
Real Name: Bev Leng
Company: Churchill China UK Ltd

Re: Mass Import Of Customers

Post by Bev13 »

Great, thanks for your help, import complete.

Bev :)
nyotrs
Znuny newbie
Posts: 17
Joined: 14 May 2013, 19:15
Znuny Version: 3.2.6

Re: Mass Import Of Customers

Post by nyotrs »

Sorry for digging up an old thread.

Can this script be modified to import other fields such as phone, fax, and etc?

Thanks!
OTRS 3.2.6
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Mass Import Of Customers

Post by crythias »

No.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
guillo
Znuny newbie
Posts: 98
Joined: 16 May 2012, 20:05
Znuny Version: 3.0.7

Re: Mass Import Of Customers

Post by guillo »

kind of related..

I've been using HEIDY MYSQL to upload information on CSV from excel into my Database and so far is working like a charm

HEIDY MySQL http://www.heidisql.com/

My OTRS is on a LINUX server and I'm working on a windows Workstation

Just conect to the DB using Heidy, select your table, go to Tools and select "Import CSV file". Is that easy.
OTRS V 3.0.7 Windows 2008 x64 going for 3.1.7
OTRS 3.1.12 on LINUX UBUNTU SERVER
kodeoneuankenobi
Znuny newbie
Posts: 18
Joined: 05 Dec 2013, 18:17
Znuny Version: OTRS 3.1.6

Re: Mass Import Of Customers

Post by kodeoneuankenobi »

Thanks guillo! I will take a look!
raviteja
Znuny newbie
Posts: 1
Joined: 25 Apr 2015, 14:43
Znuny Version: OTRS 4.0
Real Name: Ravi Teja
Company: Mouritech
Contact:

Re: Mass Import Of Customers

Post by raviteja »

Hi am configuring OTRS 4 on Centos 7. I’m a newbie to OTRS and linux. I’ve installed OTRS in centos 7 and done all the configurations. I need your help on importing bulk customer users into OTRS. I need to import the active directory users into otrs.,am unable to execute the command mentioned in above posts.

I created an excel file from libre office in centos 7 and entered some data, after first 5 columns i added a column and pasted the below formula and when tried to copy the result into the next line am getting an error as #NAME? and sometimes #REF. I pasted the result in terminal in path/opt/otrs/bin/ I executed this command =”bin/otrs.AddCustomerUser.pl -f ” & firstname & ” -l ” & lastname & ” -p ” & password & ” -e ” & email & ” -u ” & username . I need to import 200 users from active directory to otrs. I saved the file as csv in /opt/otrs/bin folder.

The Format which i tried in excel example:
ravi Teja pass111 raviteja@otrs.com ravitejam These are the fields need to be imported into otrs as customer user.

I read the reply post mentioned above and followed the same procedure but still i was unable to get the result executed.

Please suggest the way in doing the task.

thanks in advance..
Post Reply