[pmwiki-users] Subversion & existing installation

H. Fox haganfox at users.sourceforge.net
Mon Dec 12 14:06:27 CST 2005


On 12/1/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Thu, Dec 01, 2005 at 09:49:13AM -0600, Jon Haupt wrote:
> >    Q: I have an existing installation and I want to move over to using SVN.
> >    What's the best way of getting that going?
> >
> >    What would happen if I just did a checkout on top of the existing
> >    installation?  Would that work, or would it be confused, or would svn even
> >    let me do that?
>
> I just tried it, and apparently svn won't let you checkout on top of
> an existing installation.  :-(

I installed Subversion over the weekend and discovered an easy way to do it.

   svn export svn://pmwiki.org/pmwiki/tags/latest pmwiki --force

By using `export' rather than `checkout',

- you'll only get the files you want, no svn directories
 and files -- and there are a lot of those!  (657)
- you won't delete files that may have been removed
 from the distribution.  Recent example: rss.php

For those two reasons, I think  `export' is much closer to what nearly
all administrators would want.

Rather than memorizing that rather hefty command, I created a Bash
shell script for updating.  I'm doing it in a particular way partly
because I like to keep a bare-naked copy installed to use for testing
and experimenting.  The shell script also reports the PmWiki version
that was exported.

-----------------
#!/bin/bash
echo "Deleting existing wikilib.d/ and scripts/ directories."
rm -fr pmwiki/{wikilib.d,scripts} # in case file(s) were removed.
echo "Exporting the latest version of PmWiki.  (May take a minute.)"
svn export svn://pmwiki.org/pmwiki/tags/latest pmwiki --quiet --force
echo "Copying exported files to the installed wiki directory."
cp -a pmwiki/. /location/of/my/wiki
# Report the version
echo -n "The version is now "
cat pmwiki/scripts/version.php |cut -f 2 -d '"'
-----------------

You can also export a specific version.  Just change
   tags/latest
 to, e.g.
   tags/pmwiki-2.1.beta12

Hagan

> However, it appears you can do almost the same steps as for a normal
> upgrade.  Here's what I just tried on my system ... but please be
> sure to have a backup copy of your site somewhere, first!
>
> First, checkout an svn copy of pmwiki into a directory called "latest/":
>
>     $ svn checkout svn://pmwiki.org/pmwiki/tags/latest
>
> Next, recursively copy this directory and its permissions over the
> existing pmwiki installation (note the '.'):
>
>     $ cp -rp latest/. pmwiki
>
> That should do it!  You can then change into the pmwiki directory and
> issue "svn info" to make sure everything is up to date, and your site
> should still be running (albeit with the latest version).  The
> "svn update" command will bring your installation up to the latest
> release.




More information about the pmwiki-users mailing list