Migrating from Windows to Linux part 2

36 views
Skip to first unread message

Jani Tiainen

unread,
Nov 21, 2007, 2:33:16 AM11/21/07
to trac-...@googlegroups.com
As somewhere previously I asked what would be easy route to move Trac (+
SVN) from Windows to Linux.

Well I managed to get SVN very easily with svn dump/load, but now Trac
needs some loving.

Scenario:

50+ Trac projects created with Trac 0.7 to 0.10.4.

When I move to Linux server I want to do at least fix paths, and I
rather not do it by hand.

Is there easy way to recreate or modify trac.ini files to contain all
switches that new environments will have (basically filling correct info
to trac.ini.sample)

Anyone done anything like that?

--

Jani Tiainen

Chris Hill

unread,
Nov 21, 2007, 11:43:26 AM11/21/07
to trac-...@googlegroups.com
Well, its Linux so this will be a pretty simple task to script this
compared to windows. We have a php web service system set up that
manages trac users and projects.

I think what you want is to use something like sed:

sed -i "s/${SWITCH_FROM}/${SWITCH_TO}/g" $FILE

Do this for all your variables that you'd like to swap out.

This is an example. We use preg_replace in php to substitute the
strings in our trac.ini files.
C

Jani Tiainen

unread,
Nov 22, 2007, 1:06:07 AM11/22/07
to trac-...@googlegroups.com
Chris Hill kirjoitti:

> Well, its Linux so this will be a pretty simple task to script this
> compared to windows. We have a php web service system set up that
> manages trac users and projects.
>
> I think what you want is to use something like sed:
>
> sed -i "s/${SWITCH_FROM}/${SWITCH_TO}/g" $FILE
>
> Do this for all your variables that you'd like to swap out.
>
> This is an example. We use preg_replace in php to substitute the
> strings in our trac.ini files.

Well I did it with bunch of sed expressions using virgin trac.ini.sample
I had from latest release. Made things much clearer since there were not
many modifications done.

So now migration process looks like this and it seems to be painless and
working pretty well:

Windows side:
First I dump all repositories by using: svnadmin dump --use-deltas

Then just ordinary scp for Trac projects.

On Linux side:

make all project top folders as lowercase (not necessity but I wanted
to). Same thing for subversion.

svnadmin create, svnadmin load cycle for all

for a Trac projects I renamed all trac.ini's to trac.ini.win.bak, then
picked up default trac.ini.sample run with bunch of sed expressions to
fill in paths. Finally (since repository paths are changed) I ran
trac-admin resync for all projects.

Now restarted Linux apache and everything works fine.

When I've time I can put up some documentation on Wiki...

--

Jani Tiainen

Reply all
Reply to author
Forward
0 new messages