Password setup/corruption

41 views
Skip to first unread message

Michael Crookes

unread,
Jul 18, 2020, 2:03:46 PM7/18/20
to Trac Users
Hi,

I'm very new to Trac but have just setup a new Bitnami Trac VM to migrate a set of CloudForge Trac projects to (as CloudForge is closing soon).

I am now in the position where I have been able to create new Trac projects using the trac-admin ... initenv command, i am now experimenting with using sqlite3 command line to import the sql dumps that CloudForge have provided.

When I imported directly over a freshly created project I got a series of errors on the sqlite3 command line but all issues appeared to import, wiki did not.

Next step I decided to try was to use the sqlite3 command line to DELETE FROM all tables before the import but this has now set the site to require a login and I am now stuck. I tried to setup a login using htpasswd -n which accepted the change for my Trac username but this is being rejeceted by the site.

I am lost as to what process I should follow here. Any help would be greatly appreciated.

Mike 

Markus Rosjat

unread,
Jul 18, 2020, 2:20:02 PM7/18/20
to trac-...@googlegroups.com
Hi Michael,

for migration it should be simply moving files from one machine to the other, ok i talk about stand alone trac but sqlite is a file and when your trac ini was working you just need to make sure the sqlite file is in the same path or adjust trac.ini

at the end of the day migration to a new machine isnt more than that, well you might need to check plugins if you migrate to a other version of trac but migrating a project isnt more then copy files 

cheers 

MArkus 

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/e5c80c77-10f7-4230-b1fb-e7820c55ea5dn%40googlegroups.com.

RjOllos

unread,
Jul 18, 2020, 2:28:13 PM7/18/20
to Trac Users


On Saturday, July 18, 2020 at 11:20:02 AM UTC-7, Markus Rosjat wrote:
Hi Michael,

for migration it should be simply moving files from one machine to the other, ok i talk about stand alone trac but sqlite is a file and when your trac ini was working you just need to make sure the sqlite file is in the same path or adjust trac.ini

at the end of the day migration to a new machine isnt more than that, well you might need to check plugins if you migrate to a other version of trac but migrating a project isnt more then copy files 

cheers 

MArkus 

Right. Just copy the environment directory from the old machine to new machine. 

Did CloudForge provide you with a copy of the Trac environment?

If they were running PostgreSQL or MySQL you will need to load the SQL. If SQLite, it's just a file like MArkus mentioned and not SQL load is needed.

Could you list the files that Cloud Forge has provided you? Which Trac version were they running and which are you running?

You'll need to run upgrade if the Trac major version changes. Make sure to read TracUpgrade if your major version changes.

- Ryan




 

Markus Rosjat

unread,
Jul 18, 2020, 2:37:55 PM7/18/20
to trac-...@googlegroups.com
Hi again , 

 
If they were running PostgreSQL or MySQL you will need to load the SQL. If SQLite, it's just a file like MArkus mentioned and not SQL load is needed.


yeah I use postgres as a backend and my workflow is pretty simple

- create the user in postgres with the pw
- create the db and grant user rights
- restore the sql dumb

at this point stuff should be ready , and yeah try to use same names and pw so you dont need to care about the connection string in the trac.ini

cheers

Markus 
 

Michael Crookes

unread,
Jul 18, 2020, 3:55:44 PM7/18/20
to trac-...@googlegroups.com
Thanks Markus,

Unfortunately I don't have access to the original machine as this is from a hosted service (CloudForge) - I only have the snapshot they've provided which evidently included a dump of the database and not the actual database file. I managed to get round this but the issue is that the original Trac user accounts no longer seen to be valid.

I've managed to log in using the bitnami credentials these are accessible via the command line. I just can't work out how to add credentials for the original user accounts?

Does this make sense?

Cheers,
Michael

You received this message because you are subscribed to a topic in the Google Groups "Trac Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/trac-users/GmajEM9Evj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to trac-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAJ4osOmUNwUXwcz7R7oe4UKE9rtXz5XvDgZ4i3maMpdv7FcM2Q%40mail.gmail.com.

Michael Crookes

unread,
Jul 18, 2020, 4:06:36 PM7/18/20
to trac-...@googlegroups.com
Hi Ryan,

I did start a stackoverflow question on this but managed to resolve that question myself and before stumbling on this mailing list.

CloudForge was using Trac 0.12.5, new VM uses Trac 1.5.1, they provided the same sort of project folder structure so I assumed to copy across to the new project but got stuck on the database which I had to load using the sqlite3 command line.

I'm pretty sure I copied across the full directory structure to the latest test project I have - the users have just not been migrated to the new VM.

Thanks for your help.

Michael

--
You received this message because you are subscribed to a topic in the Google Groups "Trac Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/trac-users/GmajEM9Evj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to trac-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/4d88d35a-41de-478c-a15d-2baf7e394969o%40googlegroups.com.

Markus Rosjat

unread,
Jul 18, 2020, 4:07:07 PM7/18/20
to trac-...@googlegroups.com
Hi Michael,

please be aware that db access and trac access two different things! the db user is imply there to read and write to the db. Users in Trac authentication is handled by different methods like htdigest. so you need to figure out what method is used, for htdigest you usually have a file with the login informations (shouldnt be accessible from web!)

hope this gets you a bit further, regarding the dump , i dont know if sqlite has a special "dump" or simple a backup of the db file.

again db user and trac users are diffrent things!

cheers

MArkus 
 

Michael Crookes

unread,
Jul 18, 2020, 4:22:32 PM7/18/20
to trac-...@googlegroups.com
Ok, I think I need to do more investigation.

Cheers,
Mike

Markus Rosjat

unread,
Jul 18, 2020, 4:40:30 PM7/18/20
to Trac Users
Hey Mike,


On Saturday, July 18, 2020 at 10:22:32 PM UTC+2, Michael Crookes wrote:
Ok, I think I need to do more investigation.

Cheers,
Mike

I also answered to you stackoverflow question , there i said something about the cedential file you mentioned there. Maybe this helps.

Cheers

Markus 

RjOllos

unread,
Jul 18, 2020, 8:14:11 PM7/18/20
to Trac Users
On Saturday, July 18, 2020 at 1:06:36 PM UTC-7 mike.c...@gmail.com wrote:
Hi Ryan,

I did start a stackoverflow question on this but managed to resolve that question myself and before stumbling on this mailing list.

CloudForge was using Trac 0.12.5, new VM uses Trac 1.5.1, they provided the same sort of project folder structure so I assumed to copy across to the new project but got stuck on the database which I had to load using the sqlite3 command line.

I'm pretty sure I copied across the full directory structure to the latest test project I have - the users have just not been migrated to the new VM.

Thanks for your help.

Michael

On the SO issue you said:
> When I setup the new project I note that I left the default (unedited) database string but I have no idea what database type was used for the original CloudForge Trac project i.e. is there an additional step to restore the database.

The database string will be contained in trac.ini: [trac] database

If the string is "database = sqlite:d/trac.db", then you have SQLite.

If you have an SQL dump, it's likely from MySQL and PostgreSQL. I suppose they might give you an SQLite dump, but that seems non-sensical. You can't load into another database type. You'll need to load into the same database type that was dumped, then you can use "trac-admin convert_db" command if you wish to switch databases.


If they did give you an SQLite database dump, then you should recreate the db from the dump file rather than starting with a trac.db created by initenv:

Doing the latter is the reason you had to delete tables. "initenv" is creating tables and then you have to do extra work to undo that.

I wouldn't "initenv", then copy the environment over the top of the new environment. Instead:

1. Copy your environment backup to the intended location (not overwriting any existing files).
2. Create $env/db/trac.db using the dump file.

You can go from 0.12.5 -> 1.5.1 using "trac-admin upgrade" after you correctly load the database.

- Ryan

 

RjOllos

unread,
Jul 18, 2020, 8:18:15 PM7/18/20
to Trac Users
On Saturday, July 18, 2020 at 1:07:07 PM UTC-7 markus...@gmail.com wrote:
Hi Michael,

please be aware that db access and trac access two different things! the db user is imply there to read and write to the db. Users in Trac authentication is handled by different methods like htdigest. so you need to figure out what method is used, for htdigest you usually have a file with the login informations (shouldnt be accessible from web!)

hope this gets you a bit further, regarding the dump , i dont know if sqlite has a special "dump" or simple a backup of the db file.

again db user and trac users are diffrent things!

cheers

MArkus 

Right, db access is configured in trac.ini with "[trac] database" option. You don't need a special user for SQLite. The SQLite file needs to be owned by the webserver user and have r/w access for that user. For MySQL and PostgreSQL you'll need to make a user in those systems, and that user in embedded in the [trac] database string.

There's also a difference between authentication and authorization. The former is being discussed: htdigest or htpasswd are two common methods.

Authorization is handled by permissions that are granted using "trac-admin $env permission add ..."

- Ryan

Michael Crookes

unread,
Jul 20, 2020, 1:58:06 PM7/20/20
to Trac Users
Hi guys,

Just to update you I think I'm sorted now - I have manged to add the required users as suggested to the apache servers htpasswd file as required (thanks Markus for the -c info).

I have added users as per the Trac installation and this works fine. I did spend some time looking into the AccountManager plugin but at the moment this is just a nice to have and not required.

Thanks all for your help and patience.

Just a bit off topic - why do you guys not use StackOverflow?

Cheers,
Mike

Markus Rosjat

unread,
Jul 20, 2020, 2:01:33 PM7/20/20
to Trac Users
Hi Micheal,


On Monday, July 20, 2020 at 7:58:06 PM UTC+2, Michael Crookes wrote:
Hi guys,

Just to update you I think I'm sorted now - I have manged to add the required users as suggested to the apache servers htpasswd file as required (thanks Markus for the -c info).

I have added users as per the Trac installation and this works fine. I did spend some time looking into the AccountManager plugin but at the moment this is just a nice to have and not required.

Thanks all for your help and patience.

Just a bit off topic - why do you guys not use StackOverflow?

Cheers,
Mike


good to hear you sorted stuff out. rgarding StackOverflow, I used to post there once in a while but to many oppinionated Mods around so i basically stoped doing it activly. 

Cheers 

Markus 
Reply all
Reply to author
Forward
0 new messages