Welcome to Elgg's documentation

This is the place to find documentation on all aspects of Elgg. If you would like to contribute your own documentation please do; we want this to be a real community effort!

Updating a hacked installation

From Elgg Documentation

In this discussion there was a wee bit of angst about the process of updating a site when one had already applied a number of hacks/modifications. Here's my recipe for doing this without having to faff about with svn versions.

[edit] Assumptions

  1. You have modified the code you are running (eg in directory /elgg)
  2. This code was originally a copy of an svn download stored somewhere else (eg /devel)

Thus this does require that you have started out with a development version from svn and that you have copied this and made your mods to the copy.

[edit] The recipe

1 Do a diff between the current site and the svn original source.

  $diff -rq devel/ /var/www/elgg_9/ | grep -v -e .svn | sort >svn_diffs.txt

This gives a list of files that you have modded. It might be useful to keep track of these hacks and so for each set of modified files you can do the following diff:

   $ diff -iwBu devel/mod/blog/lib.php /var/www/elgg_9/mod/blog/lib.php


2 Tar gzip both current site and associated svn directory tree (just in case) and dump the database.

  • Data dir
  $ tar --exclude-from /var/elgg_excludes.txt -cvf elgg_91_data.tgz /var/www/elgg_9/data
  • dump database
  $ mysqldump -u elggbackup -pelggbackup -CQe elgg_9 >elgg91_database.sql
  • tar test site
  $ tar -czvf elgg_91_code.tgz /var/www/elgg_9/
  • tar svn base
  $ tar -czvf elgg_91_svn.tgz /home/markp/sandbox/devel/


3. run svn update.

  $ sudo svn co https://svn.elgg.org/elgg/devel/ >svn_changes.txt


4. eyeball list of hacked files (svn_diffs.txt) with list of changed files in SVN update (svn_changes.txt)

5. Copy over updated files that have not been hacked.

  • note : 'pulling' rather' than 'pushing' the copy preserves ownership. So
  $ /elgg_9/mod/commentwall$ sudo cp /home/markp/sandbox/devel/mod/commentwall/lib.php .


6. copy to-be-hacked svn updated files and apply theme hacks to these

This worked for me :-)


--Markpea 20:43, 19 May 2008 (UTC)