Export database fields to CSV file

Moderator: crythias

Locked
panres
Znuny newbie
Posts: 3
Joined: 11 Nov 2010, 04:36
Znuny Version: 2.4.5

Export database fields to CSV file

Post by panres »

We have a requirement to export selected fields from OTRS to a CSV file.

On the OTRS Admin page, under Misc, there is an option to use SQL Box to run a sql query and export the results to a CSV file.

Can this be used to export the whole database to CSV, and if so, how?
Would we need to create multiple CSV files for each table?
Could we create a Joint Query to fetch the data required from all tables and export as one CSV file?

Your feedback and assistance would be greatly appreciated.

Thank you,

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

Re: Export database fields to CSV file

Post by crythias »

panres wrote:Can this be used to export the whole database to CSV, and if so, how?
Would we need to create multiple CSV files for each table?
To be useful, probably
panres wrote:Could we create a Joint Query to fetch the data required from all tables and export as one CSV file?
There's over 20 tables. It's likely not all of them are useful for any sort of export. Besides which, you asked for "selected fields" from your first statement.

However, Yes, you probably will want to join to get something useful out of the ticket and ticket history tables.
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
panres
Znuny newbie
Posts: 3
Joined: 11 Nov 2010, 04:36
Znuny Version: 2.4.5

Re: Export database fields to CSV file

Post by panres »

Thanks Crythias,
Appreciate your feedback.
Mille Grazie
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Export database fields to CSV file

Post by crythias »

Helpful SQL queries (delete limit entry):

Code: Select all

show tables
select * from ticket
select * from ticket_history
You may also check out this link how to get everything from mysqldump into tab delimited.
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
Locked