wiki:TracUpgradeEden

Version 9 (modified by Jacob, 12 years ago) ( diff )

--

Trac Upgrade

https://www.dropbox.com/s/qla5r6q1jruvm41/Hny9yW8e.txt

0.12.1 -> 0.12.2

Do a Backup:

trac-admin /home/sahana/trac hotcopy /root/trac_backup
NOW=$(date +"%Y-%m-%d")
tar cvf trac-$NOW.tar /root/trac_backup
bzip2 -9 trac-$NOW.tar
rm -rf /root/trac_backup

Shut down Apache:

apache2ctl stop

Update Trac:

easy_install --upgrade Trac==0.12.2

Update Plugins:

cd /root/trac-install
cd accountmanagerplugin
svn up
python setup.py install
cd ..
cd externallinksnewwindowplugin
svn up
python setup.py install
cd ..
cd mathcaptchaplugin
svn up
python setup.py install
cd ..
cd recaptcharegisterplugin
svn up
python setup.py install
cd ..
cd screenshotsplugin
svn up
python setup.py install
cd ..
cd sectioneditplugin
svn up
python setup.py install
cd ..
cd tocmacro
svn up
python setup.py install
cd ..
cd trac-bzr
bzr pull
python setup.py install
cd ..
cd translatedpagesmacro
svn up
python setup.py install

Upgrade Trac instance:

trac-admin /home/sahana/trac upgrade
trac-admin /home/sahana/trac wiki upgrade
trac-admin /home/sahana/trac repository resync '*'

Restart Apache:

apache2ctl start

Test!

Old: Migration from 0.11 to 0.12 via new VM

Build new Server from CD on temporary IP

Upgrade to Squeeze

apt-get install openssh-server sudo lrzsz psmisc apt-file subversion python-setuptools python-docutils python-pygments bzr libapache2-mod-wsgi postgresql-8.4 python-psycopg2
a2enmod ssl
a2enmod rewrite
a2enmod deflate
a2enmod headers
a2enmod expires
dpkg-reconfigure exim4-config

Copy users:

adduser xxx
less /etc/shadow

(copy & paste password)

Local Repo:

mkdir -p /home/sahana/bzr
cd /home/sahana/bzr
bzr branch lp:sahana-eden trunk
vim /home/sahana/bzr/update 
cd /home/sahana/bzr/trunk
bzr pull
bzr export /home/sahana/bzr/eden.tar.gz /home/sahana/bzr/trunk

vim /etc/crontab
0 */6   * * *   root    /home/sahana/bzr/update

Fabfile:

mkdir ~/release
wget http://code.fabfile.org/projects/fabric/files/Fabric-0.9.3.tar.gz
tar zxvf Fabric-0.9.3.tar.gz
cd Fabric-0.9.3
python setup.py install
cd ..
wget http://pypi.python.org/packages/source/p/pexpect/pexpect-2.4.tar.gz
tar zxvf pexpect-2.4.tar.gz
cd pexpect-2.4
python setup.py install
cd ..
cp /home/sahana/bzr/trunk/static/scripts/tools/fabfile.py .
(restore from backup)
cp sahana_release* /root/.ssh

Install Trac 0.12.1 & Plugins:

easy_install Babel==0.9.5 Genshi==0.6
easy_install Trac
svn co http://trac-hacks.org/svn/accountmanagerplugin/trunk accountmanagerplugin 
cd accountmanagerplugin
python setup.py install
cd ..
svn co http://trac-hacks.org/svn/recaptcharegisterplugin/0.11/ recaptcharegisterplugin 
cd recaptcharegisterplugin
python setup.py install
cd ..
bzr branch https://code.launchpad.net/~trac-bzr-team/trac-bzr/trunk trac-bzr 
cd trac-bzr 
python setup.py install
cd ..
svn co http://trac-hacks.org/svn/mathcaptchaplugin/0.12/ mathcaptchaplugin 
cd mathcaptchaplugin
python setup.py install
cd ..
svn co http://trac-hacks.org/svn/sectioneditplugin/0.12/ sectioneditplugin 
cd sectioneditplugin
python setup.py install
cd ..
svn co http://trac-hacks.org/svn/translatedpagesmacro/0.11/ translatedpagesmacro 
cd translatedpagesmacro
python setup.py install
cd ..
svn co http://trac-hacks.org/svn/tocmacro/0.11/ tocmacro 
cd tocmacro 
python setup.py install
cd ..
svn co http://trac-hacks.org/svn/externallinksnewwindowplugin/0.11/ externallinksnewwindowplugin 
cd externallinksnewwindowplugin 
python setup.py install
cd ..
svn co http://trac-hacks.org/svn/screenshotsplugin/0.12/ screenshotsplugin 
cd screenshotsplugin 
python setup.py install
cd ..

Theme:

svn co http://trac-hacks.org/svn/pydotorgtheme/0.11/ pydotorgtheme
cd pydotorgtheme 
python setup.py install

Patch:

cd /usr/local/lib/python2.6/dist-packages/TracPyDotOrgTheme-2.0-py2.6.egg/pydotorgtheme/htdocs/
rm pydotorg.css
(replace from backup)
vim /usr/local/lib/python2.6/dist-packages/Trac-0.12.1-py2.6.egg/trac/htdocs/css/ticket.css +118
#comment { margin-left: -1px; margin-right: -1px; padding: 0; /* width: 100% */}

Shutdown old server

apache2ctl stop

Copy data:

cd /home/sahana
tar cvf trac.tar trac
gzip -9 trac.tar
scp flavour@eden.sahanafoundation.org:/home/sahana/trac.tar.gz .
cd /home/sahana
rm -rf trac
tar zxvf trac.tar.gz
rm -rf /home/sahana/trac/eggs/*

Upgrade:

trac-admin /home/sahana/trac upgrade
trac-admin /home/sahana/trac wiki upgrade
trac-admin /home/sahana/trac repository resync '*'

IP in Apache (SSL) as well as system (after shutting down old server):

vim /etc/apache2/sites-available/trac
        212.23.5.3
vim /etc/network/interfaces
        address 212.23.5.3
        netmask 255.255.255.248
        network 212.23.5.0
        broadcast 212.23.5.7
        gateway 212.23.5.6
reboot

}}}

Note: See TracWiki for help on using the wiki.