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
Export database fields to CSV file
Moderator: 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
To be useful, probablypanres 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?
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.panres wrote:Could we create a Joint Query to fetch the data required from all tables and export as one CSV file?
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
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
Re: Export database fields to CSV file
Thanks Crythias,
Appreciate your feedback.
Mille Grazie
Appreciate your feedback.
Mille Grazie
-
- 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
Helpful SQL queries (delete limit entry):
You may also check out this link how to get everything from mysqldump into tab delimited.
Code: Select all
show tables
select * from ticket
select * from ticket_history
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
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