Re: [Trac] Access to tickets on the command line?

2012-01-24 Thread Clemens Feige

W. Martin Borgert, 12.12.2011 14:30:

Hi,

I'm running Trac 0.11.7 and would like to access individual tickets
on the command line. With trac-admin I can remove tickets, but I
would like to access/read the summary and other fields. Is there any
way to do this? (I know, there is psql, of course.)

TIA!



Martin.

All ticket information is stored in a database. Often this is a SQLite 
database file, but can be another database system like PostgreSQL or 
MySQL. To reach your tickets you could touch the ticket table(s) inside 
the database. For SQLite for example you can read and modify a database 
with the sqlite3 command line tool.


But be warned: You will have to know about the database structure and 
you need to know some SQL before you modify the database. Anyway just 
changing a ticket summary for example should not be too complicated or 
dangerous.


Good luck
Clemens

--
You received this message because you are subscribed to the Google Groups Trac 
Users group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



Re: [Trac] Access to tickets on the command line?

2012-01-24 Thread W. Martin Borgert

Quoting Clemens Feige c.fe...@osypkamed.com:

W. Martin Borgert, 12.12.2011 14:30:

I'm running Trac 0.11.7 and would like to access individual tickets
on the command line. With trac-admin I can remove tickets, but I
would like to access/read the summary and other fields. Is there any
way to do this? (I know, there is psql, of course.)


All ticket information is stored in a database. Often this is a  
SQLite database file, but can be another database system like  
PostgreSQL or MySQL. To reach your tickets you could touch the  
ticket table(s) inside the database. For SQLite for example you can  
read and modify a database with the sqlite3 command line tool.


That's why I wrote there is psql, of course :~)
psql is the command line client to PostgreSQL.
I do not recommend to use Trac with SQLite.

But be warned: You will have to know about the database structure  
and you need to know some SQL before you modify the database. Anyway  
just changing a ticket summary for example should not be too  
complicated or dangerous.


Accessing the database is not always sufficient.
Tickets might contain attachments, that are stored
in the file system. E.g. if you do:

$ trac-admin trac-env ticket remove id

not only the database entry is cleared, but also
the file system (trac-env/attachments/tickets/).

The right solution is probably to use the XML-RPC
plugin. It contains nice Python client examples.

Cheers

--
You received this message because you are subscribed to the Google Groups Trac 
Users group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.