trac

New Trac environment with new data base


When I run the Edgewall Trac setup wizard by using the following command:

trac-admin c:\projects\trac\0project initenv

I should specify the "Database connection string", such as:

mysql://user:pasword@host:port/db

Should I have a separate database for each project, or is one common enough?

If I use one database, I get the following:

Creating and Initializing Project Initenv for 'c:\projects\trac\1project' failed. Failed to create environment. (1050, "Table 'system' already exists") Traceback (most recent call last): ... OperationalError: (1050, "Table 'system' already exists")

If I delete the shared MySQL database, then environment is created successfully. However, if I use sqlite(default), then I don't need to recreate the database.


Solution

  • The current concept is one db per Trac environment. If this is a project for you, then you'll end up with multiple databases, YES.

    TracMultipleProjects from the wiki documentation at trac.edgewall.org has some information on approaches to multi-project support, and even more details in pages linked from there. But to sum it up, all this is more or less still in the conceptual and planning stage.

    Consequently you'll find patches and Trac plugins to address and work around this missing feature. The code that is currently under most active development is SimpleMultiProjectPlugin.

    For my own applications I do constantly observe the situation while sticking to the status quo: multiple environments side-by-side in one parent directory. I've found nothing else, that would allow to stay close to upstream (promise for painless upgrades) without limiting the choice of db type or other things.

    Some Trac plugins have been developed or improved to cope with that situation. Just to name some, recent AccountManagerPlugin code has single-sign-on capability, and SearchAllPlugin extends the full-text search to include a configurable list of surrounding environments.