<div class="gmail_quote">On Fri, May 27, 2011 at 9:44 AM, Oguz Altun <span dir="ltr"><<a href="mailto:oguz@ce.yildiz.edu.tr">oguz@ce.yildiz.edu.tr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I have this wiki installation that I spend quite a time to install recipes, write my own download application, etc... So, I want to just transfer (some of) it to this new site, change the logo, skin, etc, and get a new site with hopefully much less work. In fact It would be real fine to periodically sync them, to ease maintaining.<br>

<br>
The two sites are running on linux machines, and my only access is through ftp. So, no rsync or unison to me. Furthermore, my desktop machine is a windows. So when I transfer to my desktop, e.g. by wget, permissions are lost. Big down for me.<br>

<br>
So, how can I transfer/sync these two? Thx.<br></blockquote><div><br>I think you've got a problem here that won't be solved in a single step...<br><br><a href="http://ask.metafilter.com/117897/Remembering-permissions">http://ask.metafilter.com/117897/Remembering-permissions</a><br>
<br>FTP doesn't "do" permissions and ownership well.<br><br>A little browsing came up with this tool:<br><br><a href="http://winscp.net/eng/index.php">http://winscp.net/eng/index.php</a><br><br>which may or may not be able to handle it.  Looks like it does have some nice sync capabilities.  But I don't think the permissions & ownership are really solvable by FTP in a generic way since you're dealing with cross-platform issues...<br>
<br>This may be helpful in the sync-over-ftp realm as well (it's what I use as my backup solution both locally as well as to the cloud):<br><br><a href="http://www.2brightsparks.com/syncback/">http://www.2brightsparks.com/syncback/</a>  <br>
<br>(SyncBackSE has some helpful features that are definitely worth the price, but the freeware version should handle what you need at least at the start)<br></div></div><br>Unfortunately I don't think any of these are solving your ownership and permission problems.  However, maybe a simple custom action might be able to fix things for you -- try putting this in your config.php (or in a page-specific customization file):<br>
<br>===(snip)===<br>$HandleActions['fixperms'] = 'FixPerms';<br>$HandleAuth['fixperms'] = 'admin';<br>function FixPerms($pagename, $auth='admin')<br>{<br>   if (!RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT)) { Abort("?unable to read $pagename"); }<br>
   foreach (ListPages() as $file)<br>      fixperms($file);<br>}<br>===(snip)===<br><br>CAVEAT #1: I haven't actually tested it (minor detail - *grin*) but it's maybe a start in the right direction<br>CAVEAT #2: I'm not sure what implications this might have security-wise...  Other wiser folks will have to give their input on that.<br>
CAVEAT #3: I'm not sure if fixperms() will be able to handle the difference between FTP owner and apache owner...  However, I think that's just a quick chown with a wildcard via FTP (could be included in an FTP script, I believe)...  (Again, haven't tried it)<br>
<br>The overall idea would be to sync with server #1 to your windoze machine, then sync to server #2 using the same directory in windoze.  Now #2 and windoze are entirely most-recent.  Then do the sync back to server #1 and all directories are in sync.  Then load a page on each server with ?action=fixperms appended to the URL and theoretically everybody is a happy camper...<br>
<br>-Peter<br>