On Nov 17, 2013, at 8:49 AM, Chris Lott <[email protected]> wrote:

> I work a lot in areas without web access. I'd like to have a two-way
> sync between a local installation of pmwiki on my Macbook and my
> "real" wiki. I'd prefer to sync the whole wiki, not just a group.
> 
> I've browsed around but not found a solution for syncing the whole wiki.
> 
> Given that PmWiki's design is around files, I'm hoping this doesn't
> have to be too hard?

Let me toss out another idea besides the two-way rsync thing, although it has 
some serious deficiencies.

This assumes you have ssh access to the wiki directory on your server (aka 
remote).

This is what I’ve done, though I haven’t really documented it.

The remote wiki is the "blessed" repository for this. First initialise git in 
the wiki root directory:

$ cd path/to/wiki_root
$ git init

You probably want to make a .gitignore file that contains at least the 
following:

wiki.d/.flock
wiki.d/.lastmod
wiki.d/.pageindex
wiki.d/*,del-*

Stuff everything else in the repo:

$ git add —all —verbose
$ git commit -m 'Initial commit'

Make note of where your wiki is and how you’ll access it via ssh:

$ pwd

On your local machine, you’ll now clone the remote wiki:

$ git clone user@remote:path/to/wiki_root wiki-clone

Keeping things in sync can be a bit tricky. Generally, you want to pull things 
from the remote before you start making changes on the local, and push things 
from the local back to the remote before you make any changes remotely.

If you run into merge conflicts, since the pmwiki page structure stores the 
entire content on a single line, you could have problems in fixing things. 
Likewise, since the change history is stored in the wiki page, similarly 
discrepancies in making changes could make merge conflicts a bear to deal with.

If you are the only one editing your "real" (remote) wiki, then it might work 
better to do all your edits on your local wiki, and push to the remote. If 
others also edit your wiki pages, the pull/edit/push is going to be required.

I use this method for my personal wikis, primarily as a means to develop, test, 
stage, and then release to production.



_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to