• Keeping WordPress up to date using the standard method of deleting old files, extracting the new ones and then running the database upgrade script is a bit cumbersome, but really not that difficult. Gallery2 uses more or less the same methodology, but it does not require you to delete your files prior to the upgrade because it generates a script to remove deprecated files after the install is complete. This is very kind of them, but the Gallery package is large, and upgrades can get a bit unwieldy. While there are certainly more difficult software packages to maintain, there are things I would much rather be doing than software updates, so I decided to make my life easier by using subversion to manage both applications.

    Subversion is a code revision management tool that is everything CVS should have been. It is not only amazingly useful for software developers, but it can be readily used by end users as a convenient method of keeping their software up to date. It is for this reason that the Automattic and and Gallery folks have started recommending it for those who have command line access to subversion enabled servers.

    There is no way to force the software to make an existing install into a subversion checkout, so to convert my site, I pretty much just followed the instructions at wordpress.org site.

    Create a directory for the new install and “cd” into it:
    $ mkdir wordpress-svn

    Checkout the current WordPress version:
    $ svn co http://svn.automattic.com/wordpress/tags/2.3.1 .

    Copy the things I cared about into from the old directory into the new one:
    $ cp ../wordpress/wp-config.php .
    And the same for:
    favicon.ico
    .htaccess

    The only thing I didn’t really like was their method for copying the files from the old wp-content directory to the new one.

    They suggested using “cp -rpf”:
    $ cd wordpress
    $ cp -rpf wp-content/* ../wordpress-svn/wp-content

    But I prefer to use a “tar | tar” operation as root from my original wp-content directory.
    $ cd wordpress/wp-content
    $ tar cpEf - * | (cd ../../wordpress-svn/wp-content; tar xf -)

    I don’t really have a reason for this other than it’s the way I have always moved large directories full of files with varying permissions. I just have more confidence in “tar” to maintain permissions than I do “cp”. I seem to remember being bitten by “cp” while moving some Oracle databases at some point.

    That pretty much did it for WordPress… Next I moved onto Gallery2. The process was very similar.

    Create the new gallery2 directory within your wordpress-svn folder and “cd” into it:
    $ mkdir gallery2

    Checkout the latest version of the Gallery2 code:
    svn co https://gallery.svn.sourceforge.net/
    svnroot/gallery/branches/BRANCH_2_2/gallery2 .

    Copy over the config file:
    cp ../../wordpress/gallery2/config.php .

    Finally, copy the g2data directory over using “tar | tar”:
    $ cd ../../wordpress/gallery2/g2data
    $ tar cpEf - * | (cd ../../wordpress-svn/gallery2/g2data; tar xf -)

    That was it… Now all that was left was to rename wordpress to wordpress-presvn and wordpress-svn to wordpress:
    $ mv wordpress wordpress-presvn; mv wordpress-svn wordpress

    Everything worked fine, so I was golden. If it had not been, I could have simply renamed the directories back to their original names.

    What did all this get me? Much much easier upgrades. Upgrading WordPress is now just a matter of switching to the latest tag and running “svn up”:
    $ svn sw http://svn.automattic.com/wordpress/tags/2.3.2
    $ svn up

    With Gallery, however, there is no need to do a switch for dot releases, so until it goes from 2.2.x to 2.3.x there is no need to run the “svn switch”… I can just “svn up”.

    Remember that this is a 10,000 foot view of the process. Please read the links to the Automattic and Gallery documentation if you are going to make the move yourself.

    This entry was posted on Friday, November 30th, 2007 at 6:52 pm and is filed under Data and Technology. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
  • 1 Comment

    Take a look at some of the responses we've had to this article.

    1. Dec 10th
      Reply

      Dude. Thanks for the instructions! I’m all svn’d up now! w00t w00t!

  • Leave a Reply

    Let us know what you thought.

  • Name (required):

    Email (required):

    Website:

    Message:

Visitors have tagged this post: t (74) - subversion (18) - wordpress gallery2 (15) - gallery2 wordpress (10) - favicon gallery2 (9) - gallery2 favicon (9) - gallery2 ldap (7) - gallery2 svn (5) - gallery2 favicon.ico (4) - wordpress gallery2 sample (3) - gallery 2 favicon (3) - how to install Gallery 2 in wordpress (3) - subversion wordpress (3) - installing gallery2 in wordpress (3) - gallery2 https (3) - gallery2 ldap howto (3) - tar cpEf (3) - gallery2 wordpress example (3) - gallery2 subversion (3) - gallery2 active directory authentication (3) - how to add gallery2 album to wordpress (3) - favicon.ico gallery2 (3) - add favicon to gallery2 (3) - wordpress gallery2 themes (3) - tar without svn (2) - gallery2 svn upgrade (2) - wordpress subversion (2) - favicon how to install in wordpress (2) - gallery2 active directory (2) - gallery2 svn co (2) - gallery2 favicon ico (2) - cp maintain permissions (2) - subversion favicon (2) - cp maintain original permissions (2) - WPG2 ldap (2) - subversion manage (2) - gallery2 AD authentication (2) - wordpress with gallery 2 (2) - how to add gallery 2 to wordpress (2) - wordpress gallery 2 howto (2) - http://www google com/ig?hl=en (2) - tar without svn directory (2) - gallery2 wordpress htaccess (2) - wordpress svn wp-content (2) - favicon in gallery2 (2) - Managing wordpress (2) - wordpress and gallery2 (2) - gallery2 subversion installation (2) - gallery2 LDAP Active Directory (1) - gallery2.3 upgrade database (1) - gallery2 favicon settings (1) - htaccess wordpress wp-content (1) - LDAP Gallery2 (1) - favicon to gallery2 (1) - folder permissions ldap subversion (1) - gallery wordpress 2.2.x (1) - wordpress gallery2 how to install (1) - gallery2 install directory wordpress (1) - gallery2 favicon.ico folder (1) - gallery2 uninstall (1) - how to install new theme in gallery2 (1) - Setup Gallery2 with WordPress (1) - installing gallery2 on centos 5 (1) - add gallery2 albums to website (1) - wordpress gallery2 installazione (1) - svn install gallery2 in centos 5 (1) - svn wordpress template (1) - wordpress svn delete (1) - managing wp gallery from code (1) - gallery2 howto favicon (1) - gallery2 examples (1) - wordpress two galleries in same post (1) - update gallery2.1 to gallery2.2 (1) - wordpress show gallery2 latest albums (1) - gallery2 manage user permissions (1) - gallery2 as wordpress page (1) - CD wordpress website (1) - gallery2 how to add favicon (1) - maintain website with subversion (1) - gallery2 setting up checkout (1) - gallery wordpress permission (1) - gallery 2 with wordpress (1) - wordpress gallery2 from old gallery (1) - installing gallery2 on OS X server (1) - gallery2 wordpress breaks links after upgrade (1) - two galleries one post wordpress (1) - wordpress 2 galleries one post (1) - howto intsall gallery to wordpress (1) - gallery2 help favicon.ico (1) - svn up permissions (1) - example wordpress gallery2 (1) - gallery2 active-directory (1) - how to install gallery2 wordpress (1) - set up gallery 2 manual (1) - install gallery2 from svn checkout (1) - wordpress gallery2 simple theme (1) - gallery2 in wordpress2 (1) - gallery in wordpress (1) - svn folder privileges (1) - gallery2 permissions (1) - how to create a wordpress gallery (1) - gallery2.2 g2data (1) - how to install gallery with wordpress (1) - mac os x cp remove .svn (1) - gallery2 example (1) - gallery 2.3 Storage Directory Permissions (1) - wordpress gallery howto (1) - gallery2.3 (1) - g2data and gallery2 and install and 2.3 (1) - website in subversion (1) - favicon wordpress htaccess (1) - svn centos winbind (1) - centos 5 gallery2 (1) - how to install gallery in the wordpress (1) - wordpress Gallery2 2.2 (1) - gallery2 Create Config File (1) - favicon not shown gallery2 (1) - reinstall gallery2 but maintain everything there now (1) - how to instal Gallery2 in wordpress (1) - gallery centos HOWTO (1) - default permissions in Gallery2 (1) - subversion ldap permissions (1) - gallery2 manage site (1) - wordpress subversion permission (1) - wordpress gallery2 comments (1) - setting gallery2 up on an os x server (1) - favicon gallery2 php (1) - wordpress and gallery2 themes (1) - gallery2 httpd auth (1) - svn wordpress (1) - gallery2 software package centos (1) - wordpress svn theme (1) - subversion and oracle packages (1) - Gallery 2 how to install in wordpress (1) - where to install gallery2 in wordpress (1) - installing gallery on centos (1) - wordpress gallery2.2 (1) - wordpress svn content (1) - how to install Gallery wordpress (1) - subversion to manage website (1) - gallery2 show in wordpress (1) - manage wordpress installation svn (1) - gallery2 theme howto (1) - Gallery2 AD auth (1) - How to manage website through svn (1) - managing pages in wordpress (1) - ldap settings gallery2 (1) - gallery 2 examples (1) - update gallery2 checkout (1) - how to run gallery wordpress (1) -