Local site doesn’t do URL rewriting to fetch offloaded media
My production site has media files offloaded to Google Cloud Storage (GCS) using WP Offload Media.
After pulling the site from Flywheel into Local, WP Offload Media has lost the Storage Provider settings and no URL rewriting is being done, thus, no local access to any of the offloaded cloud media.
When I start to set the provider to GCS on the local site, it warns me that I have thousands of offloaded media files that should be removed before proceeding. No way! I don’t want to risk messing up the production site.
Any advice on how to use Local when my production media is offloaded with WP Offload Media? Editing a media-rich website with no media files is a show-stopper for using Local.
OS is WIndows 11 Pro, build 26100. I regularly install latest updates and patches.
Local is version 9.2.9 - I just installed it for the first time last week.
Local logs are attached.
Looking at the WP Offload Media settings on the local site, I see it’s complaining about the Storage and Delivery settings. Attached are screen shots from the production (Flywheel) and Local plugins.
I reached out to our friends at Delicious Brains, and they’d like to help you further if you want to reach out to them directly for more support. There should be a Help tab inside the plugin’s UI, where you can get that started and share logs. Here is the full response from one of the DB Devs with some more information as well:
It should be fine to work with Local. It’s likely that the configuration and access keys in wp-config on the production site are not copied to Local. HOWEVER: The customer will probably not want to copy all of the settings from production over. It’s likely that they want to remove the access keys so that their development site doesn’t delete or overwrite any media (as they have correctly identified).
This article explains: Strategies for Handling Large WordPress Media Libraries in Dev and Staging Environments
I would start by getting them to open a ticket with support and making sure the diagnostic info from the “Support” tab of the Offload Media settings is sent through. Once the ticket is open, have them send the diagnostics from the other site so that we have both.
DO NOT have the diagnostic info posted to the Local forums as it contains sensitive information about the customer site
Just for the sake of anyone in the future with this problem: There is a simple solution. Apparently, when Local ‘pulls’ a site that is using WP Offload Media, configured with Google Cloud Storage as the cloud service, from Flywheel - the ‘pull’ does not include the AS3CF_SETTINGS constants defined in the wp-config.php file.
Dropping the following code in my local wp-config.php file was enough to get the offloaded media to appear in the local site:
This connects the local site’s WP Offload Media plugin to Google Cloud Storage for fetching offloaded media. It does not allow the local site to modify GCS in any way which is good for me - the production system is ‘safe.’
The support people raised a flag that I’ll include below:
So…to be safe, whenever I push the local site back to production, I’m only pushing specific files that I’ve modified. Hope this helps someone, some day.