How to easily upgrade sites
Preparing
- Get the site down. this is important otherwise you're fucked with dbase patches
- get a cvs copy of both old version and new version. (or from a tarball).
Updating scripts
- update scrips/ folder. usually cp'ing the new script files should do the trick. or cp the whole folder. if files differ check if they're modified.
Updating website.
- Check which files are changed.
diff -r --brief --exclude=CVS /path/to/old/version/website/dir /path/to/newversion/website/dir
(mat)Example:
diff -r --brief --exclude=CVS /home/maritimes2/website/ /home/maritimes2/sitename/ | more
- copy over the files that are changed. don't forget to copy over new files.
Updating local
(mat)Example:
diff -r --brief --exclude=CVS /home/maritimes/local/ /home/maritimes2/local/ | more
- There are 3 dirs: include/ config/ templates that need to be checked.
- Sfactive.cfg
- This is a hard one. i usually do diff them and go about line by line.
diff -cbw current_file new_file | more
- templates
- compare what got changed between oldversion and newversion with what differs from oldversion with current files:
diff -r --brief --exclude=CVS /path/to/old/version/templates/dir /path/to/newversion/templates/dir
diff -r --brief --exclude=CVS /path/to/old/version/templates/dir /path/to/current/templates
-
- copy over new files. for modified files you'll have to diff -cbw them one by one and merge them. if people modified their own templates they'll for sure are able to merge them in admin themselves usually.
(mat)Example:
diff -r --brief --exclude=CVS /home/maritimes2/local/ /home/maritimes/local/ | more
Patching the dbase
- see what database patches there are for your release (they're in sf-active/install/)
- apply them one by one in the order they should be applied (usually this doesn't matter).
Permissions
- if you copy over existing files, permissions should stay.
- for new files, usually we do this:
- files: 664 | directories: 775
- owner: yoursite:yoursite
- webwritable files : www:yoursite so apache can write to them and groups can write to them in shell
- to update large dirs (like uploads/), use find (you might get errors with chmod -R)
find . -type f -exec chmod 664 {} \;
Bring site up
- Change the eventual include path in httpd.conf
- make sure sfactive.cfg points to new shared/dir
- make sure your site is included in the correct global.cfg file
Post upgrade
- You might have to regenerate articles. do 300 most recent ones first, then start from zero
- if you go to 0.9.4: add a default language in the admin (otherwise publish and alikes are broken)
- Go to the fridge/cellar and serve yourself quality belgian beer
--
PseudoPunk - 17 May 2006