Thanks for this! I've been using method #4 and it works pretty well, but #5 is a good addition to my toolkit. Very clever technique :)
You are welcome David
Interesting read! I've never worked on a project long enough to have the need to keep media in sync but they're starting to appear in my workload so this came in the nick of time! What's your favorite?
Currently it is #4, I use it a lot when a project is in its early stages, when the client is adding content/media to the staging site and I can keep my local in sync with it.
To be honest #4 and #5 don't feel like "synchronization" to me, as it's basically still connected to the place the files are. I don't have them over at the local testinstallation - and (more important maybe) i got no backup of the files. So RSync or FTP are the way to go, even if it might take some time to get the files physically over to the second installation. Also: If I understand that right the uploads remain on the server, so upload works only on one side of the system (the live site in your examples). On the other side: very good solution if you do "only" designing work on the site.
This is a very good thing if you need to make a few changes and the live site has a 2GB uploads directory. You don't want to wait all morning to download a bunch of files. That's where .htaccess and filter method comes in handy.
I am confused... I am trying to do this function: I am using a load balanced server set with a Lamp setup on a Wordpress site distribution. I have successfully place the database to a third standalone server and am looking to do the same with the "uploads" folder. Is there anyway to do this with the methods you are referring to? 4 looks awesome but I am unsure of what you are doing and why this would work and or solve my problem.
found a solution... Unison... the very best way to get going... it is a master to master sync which can literally be done completely from one server no matter what happens on either side... Freaking awesome.
I have a sort of different situation - I am using a load balancer in front of 3 web front ends for WordPress. I can put persistent connections on so I can log into /wp-admin and make posts, but when I install a plugin or add media the web frontends are out of sync from a file perspective. Database is good, since I run that on a remote MySQL server, but how can I sync web servers in a load balancer?
use a shared mounted storage location across all 3.
Good roundup post. I just purchased the Media add-on for Migrate DB Pro, will be trying it out soon. I also just found out about 'Uploads by Proxy' (https://wordpress.org/plugins/uploads-by-proxy/) which appears to be a variation of #4 and #5 above – the local installation will pull media from the production site. Again, I haven't tried it out yet, but it looks promising.
If you're dealing with two wordpress installs, you can use define('UPLOADS', "wp-content/other_uploads"); in your wp-config.php with a soft link from the command line ln -s /path/to/wordpress/source/uploads /path/to/local/new/folder/wp-content/other_uploads or alternatively just use the full path in wp-config.php
Love method 4. The only time it doesn't work for me is if I add an image size and need to regenerate thumbnails. Any ideas how to get around that? I could always just add the image size on production and regenerate there, but ideally I'd be able to see how everything looks in development before deploying any of it to production.
At that point, might as well download all the images to dev and test there.
rsync all the way!