In September 2006 I made a major decision on my company Source Code Management (SCM) strategy and signed up with http://www.hosted-projects.com, which provide a hosted solution for SubVersion, Trac and Bugzilla. A few years earlier, I’d already moved my SCM from SourceSafe to SubVersion hosted on my own server on a local network. However, I really wanted to move to a hosted provider so I could have remote access to the SCM without worrying about firewall configuration and software updates, never mind having to leave a server on 24 hours a day in a home office.
As well as SubVersion I gained access to Trac and Bugzilla. I never really got on with Bugzilla, but Trac became an essential tool for helping me to organise my own work schedule and enable remote development for clients. Within months I realised how useful, and essential, a hosted solution had become and so signed up for backups of both SVN and Trac. I have access to daily backups and these are included them in my own weekly backups.
During the last three years I’ve been shockingly neglectful and trusted the guys at Hosted Projects and never actually attempted to restore the Trac backups. For my hosted service, Trac is run on a Linux server, but with a complete dump of the Trac folder structure in the backup I suspected getting it working under Windows was completely feasible. I finally restored my first Trac/SubVersion combined backup last week, and was impressed at how quickly I had it working, although you do have to be careful.
This blog details how I took my SubVersion and Trac backups and restored them to run under Windows 7. Hopefully this should be the first in a series of blogs;
- Restoring a Trac installation onto Windows
- Installing a new SubVersion/Trac repository onto Windows
- Configuring Trac to use Mercurial instead of SubVersion
- Configuring Trac to use GIT instead of SubVersion
The following installation notes were made on Windows 7 Ultimate 64 bit running under VirtualBox 3.1.2.
Documentation available for installation of Trac on Windows
The Trac project is available at http://trac.edgewall.org, with the latest stable release of Trac being 0.11.6. This is the version running on my Hosted Projects service.
The general installation instructions for Windows can be found at, http://trac.edgewall.org/wiki/TracOnWindows,
More importantly there are incredibly useful step by step instructions at, http://trac.edgewall.org/attachment/wiki/TracOnWindows/Step_by_Step-installation-manual.txt
Planning and downloading the correct setup components
It is possible to get information on the version of Trac you are running at Hosted Projects, you can click on the ‘Powered by Trac 0.11.6’ link at the bottom of the home page. This provides a detailed list of the versions of all the components within the Trac site.
In addition to Trac 0.11.6, I needed Python 2.5.4, python-2.5.4.msi,
I found the setup tools in the Python Packages area, http://pypi.python.org/pypi, under http://pypi.python.org/pypi/setuptools/0.6c11#downloads,
For the setup tools, I downloaded the MS Windows installer that matched my version of python, setuptools-0.6c11.win32-py2.5.exe
Genshi is the Python library used to generate web pages. This package is hosted by edgewall.org, the same guys responsible for Trac, at http://genshi.edgewall.org/wiki/Download. Again, I downloaded the MS Windows Installer that matched my version of python (2.5), Genshi-0.5.1.win32-py2.5.exe.
Okay, who thought if was funny to hide the SubVersion download?
To enable the SubVersion integration I headed off to Subversion, http://subversion.tigris.org/, but was redirected to as they have been accepted to the Apache Incubator at http://subversion.apache.org/ . Click on Getting Subversion->Binary Packages on left hand menu (and then selecting Windows), you can locate the Windows installation files, http://subversion.apache.org/packages.html#windows
In the list is SlikSVN, which would by normal suggestion for your standard end user who wants a simple installer but not what I really needed for a Trac installation. However, also present on this page is a link back to tigris.org, and it is where I ended up for the Apache 2.2 compatible files, http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100.
I downloaded two files; the SubVersion command line setup and the SubVersion Python module integration; Setup-Subversion-1.6.6.msi and svn-python-1.6.6.win32-py2.5.exe.
- python-2.5.4.msi (install for all users)
- setuptools-0.6c11.win32-py2.5.exe (Run As Administrator)
- Genshi-0.5.1.win32-py2.5.exe (Run As Administrator)
- (reboot system)
- Add c:\Python25;C:\Python25\Scripts to path. (Windows 7, Control Panel -> System and Security -> System -> Advanced System Settings, Environment Variables button)
- Setup-Subversion-1.6.6.msi (install for all users)
- svn-python-1.6.6.win32-py2.5.exe (Run As Administrator)
- Trac-0.11.6.win32.exe (Run As Administrator)
- For a restore, create c:\project\trac, then copy the entire backup folder tree to, say, c:\project\trac\tiger
- Assuming you have restored the SubVersion repository, edit the Trac configuration file to point at the restored SubVersion repository; repository_dir = c:\svn\tiger (for my folder layout the configuration file is at, c:\projects\trac\tiger\conf\trac.ini)
- Resynchronise the Trac database with the SubVersion repository in its new location using the trac-admin python script; trac-admin c:\projects\trac\tiger resync
- Create the file c:\Python25\Scripts\trace-digest.py as detailed in the step by step guide to support creating a ‘users’ text file with encrypted passwords
- You can then use trace-digest.py to create users (for myself that meant the same login names as already present in my Trac backup); trac-digest.py -u "admin" -p adminpassword >> C:\projects\trac\users.txt
- Finally run the python script to create Trac web server listening for requests; tracd-script.py -p 80 --auth="*",C:\projects\trac\users.txt,trac c:\projects\trac\tiger
- Browse to http://127.0.0.1/tiger, and log in as the admin user you have configured
The lesson should be that I should have attempted this restoration of a vital backup many years ago, but it does prove that the Hosted Projects backup solution is happy to restore to a different operating system if required.
My aim is to write up how to create a completely new SubVersion/Trac installation which should be fairly similar to the above, but will include initial creation of the Trac installation and SubVersion repository. I suspect it may also require more details regarding the configuration options, as this will not be a canned backup that has most of the options pre-configured.
- When I first installed Python I glibly installed the 64-bit version, ignoring the fact that the supporting modules were only 32-bit. This meant that the 32-bit modules complained that Python was not installed, as they could not locate the correct registry entry. Never forget that there are separate registry hives for 32-bit and 64-bit programs. I went back to a 32-bit Python install as security/performance is not really a consideration for myself, I just want to be able to restore a Trac system in an emergency.
- User Access Control is present under Windows 7 (although this could equally apply to Vista or Windows Server 2008). While an MSI installer will ask for permission when it executes, any ‘old fashioned’ setup files that are a standalone EXE have to be Run As Administrator manually, otherwise they will fail;
- The first time I ran Trac I had not installed the SVN Python tools, something that was missing of the Trac on Windows installation notes.
- Once the SVN Python tools were installed, I then received a message within Trac that the location of the SubVersion repository had changed and I needed to use a trac-admin resync command to synchronise the local SubVersion repository check in data to the Trac database.
- If you have trouble in Windows 7 finding how to change the Path environment variable setting, this image might help,
| posted on Tuesday, February 2, 2010 10:38 AM