Sync local and remote images

Mark Jaquith has a handy snippet for syncing Photon images between a local install that doesn’t have a copy of the uploads folder and the remote, Jetpack enabled site.

What if the site you’re working on has like, 30GB of image uploads? You certainly don’t want to have to rsync those down just to dev on the site. You probably want this: images you upload to your local install work, and images that exist only on the production server also work. Well, that’s what this does.

The solution reminds me of another by Brian Richards, which utilizes Nginx or Apache rewrites to do the same thing, but it doesn’t matter if the files are stored on Photon.

Yet a third option is the Migrate DB Pro media files add-on, which actually downloads the files from the remote site to local (I just did this today for Post Status). That of course takes a bit longer, but has its own advantages.

It’s nice to have options for tasks like this. I can imagine scenarios in the last year where each of these would’ve had their place. Hopefully it’ll help you as well.

Similar Posts