Sync local and server Contents folder

My client’s website has just gone live. The client is still adding and changing content via the Panel.

I am also working on elements of the site, locally on my PC. This is mainly CSS and template stuff, but occasionally adding or changing content. Which I then add to the server using FTP.

It is difficult to keep track of where the most recent content is – on the server or on my PC.

Is there a way for me to work on the site locally, with the Assets, Kirby, Site folder etc – but use the Contents folder on the server? So that there is only one Contents folder?

Is there a way to synch the contents folder without using Terminal?

I’d need to sync in both directions (local to server and server to local)

My code editor is Sublime Text which doesn’t come with support to connect to remote servers via FTP/SFTP and sync files automatically.

… perhaps Cyberduck or Mountain Duck might work?? Replace my Contents folder and replace it with the mounted remote folder? Is that possible?

I handle it this way:

  • I only edit content on the live server.
  • Then I synchronise the ‘content’ folder ‘server-2-local’ with Transmit on my Mac, as the customer will most likely only change this folder.
  • I introduce changes to the ‘assets’ and ‘site’ folders locally on the Mac and then synchronise ‘local-2-server’ again with Transmit.

With Transmit you can create rules to specific exclude folders/files.
Visually, the rule list is unfortunately poorly realised, but it works very well.

Of course, I am also genuinely interested in how others do this and whether there is a more efficient way.

Can you set up Transmit to sync the contents folder both ways, at the same time, ‘server-2-local’ (for changes in the Panel by the client) and ‘local-2-server’ (for changes I make to the contents)?

I find I make changes to the txt files, locally, using a code editor – doing find/replace changes across multiple pages and often as the site is developing removing old content from fields that no longer exist.

I use rSync for deploys and also for syncing content down in the other direction. I keep the local server copy under Git, so that when i need to make changes locally, i run rSync to pick up any changes the client may have made on the live server and then commit it before doing the work and syncing back to the live server.

You can set rsync up to run via an NPM script so you can just type say npm deploy:live… i have a few scripts that push and pull from staging and live servers.

This will only work though if you have SSH access to your server since rSync uses SSH to connect to it.

I’m hoping to find a way with a GUI – avoiding another layer of complexity that is Git and command-line stuff.

Mountain Duck is driving me nuts, it doesn’t seem very stable and the GUI is confusing. So I’ll try Transmit

While I do prefer using the CLI with rsync, etc., I resort to Transmit’s Filesync Feature when only S/FTP access is available.

I was hoping this set-up would work:

I have replaced the Contents folder with a folder synched to the Contents folder on the server. This is using Mountain Ducks show ‘connected server’ on desktop function.

Screenshot 2024-09-18 at 1.18.16 PM

Trouble is Kirby is not treating this synched ‘connected server’ folder the same as a normal folder and the website is not working (the homepage doesn’t exist).

Which is a bit of a blow

I am not familiar with Mountain Duck, can you explain what the content folder is in technical terms when this feature is running (as it doesn’t seem to be an actual folder).

Also as I see it capitalized, have you tried it with lowercase spelling (content)?

I’ll try!

Mountain Duck creates synched “folders” on the Mac Finder desktop. The folders are like a remote drive (if that’s what they are called). To show them on the desktop in the Finder settings “connected servers” needs to be ticked.

I tried moving the connected server thingy into my Kirby folder but it created an alias.

Still doesn’t work even with lower case “content”.

The debug message is:

Kirby \ Exception \ NotFoundException (error.notFound)
The home page does not exist

It would be great if this worked


Screenshot 2024-09-18 at 2.23.09 PM

I’m guessing Kirby can’t work with an alias ‘content’ folder, or maybe the issue is that it is not really a normal folder.

Indeed it seems Mountain Duck is using MacOS Aliases and not regular symbolic links.

Any ideas if there is a way to get the alias of the Mountain Duck “mounted drive” synched content folder to work with Kirby?

Slightly different approach:

Is it possible to replace the standard Kirby contents folder, with a synched “mounted drive” called contents that lives on the desktop (not inside the normal Kirby folder)? i.e. link to a different contents folder?

If so, my concept might yet work.

I’m like you and prefer a GUI, I currently use FreeFileSync to keep my site synched up between local and server copy.

There’s a RealTimeSync feature that do what you want: FreeFileSync

Note that you’d need to pay for the Business edition (20 euros) if it is for commercial use.

I’d be careful with real time sync though. It may cause issues if you and the client edit a file at the same time, and mistakes are immediately synced to production. Personally I wouldn’t do it esp. when it’s your client’s website.

1 Like

Great… I’ll take a look

Any idea if I can sync the contents folder (both ways) – while I work on the files locally in the Assets and Site folder? I’d only want to push changes to CSS, templates and blueprints etc to the server when I’m happy with them locally.

Yep, you have bidirectional sync as an option, so you can monitor the content folder using RealTimeSync and sync the rest of the site manually.

That sounds promising…

I’ve got FreeFileSync to sync my local Content folder and server Content folder, both ways. So that’s great. I like the way it compares files and only syncs the files that need syncing. This saves me having to copy the entire Contents folder across, which takes time and has the potential to overwrite newer content by mistake.

I have not been able to get RealTimeSync to work. It says my FTP doesn’t allow real monitoring.

But I probably prefer having the control FreeFileSync gives – I can see which files need syncing and can allow or not.

Thanks for the suggestion

@Baldono as you can read above, he has encountered problems with those. maybe you can actually assist in how to get those running properly.

Yeah, the problem is Mountain Duck’s local drive is mounted on the Mac desktop. I’ve tried moving it to inside my Kirby website folder - to replace the Contents folder - but it creates an alias. And this doesn’t work with Kirby.

However FreeFileSync will sync the Contents folder with the Contents folder on the server (both ways), so this is a good solution.