Skip to content

Instantly share code, notes, and snippets.

View nurtext's full-sized avatar
🚀
Don't tell me the sky is the limit, when there are footprints on the moon

Cedric Kastner nurtext

🚀
Don't tell me the sky is the limit, when there are footprints on the moon
View GitHub Profile
@nurtext
nurtext / additional_queries.sql
Last active January 8, 2019 11:07 — forked from jashk/wp_offload_media_db_migrate.json
Migrate a WordPress database so that existing media items are served from Amazon S3 or CloudFront. Requires the WP Offload S3 Lite plugin.
--- Updated queries for a bedrock-setup which doesn't use the default path settings
UPDATE wp_posts SET post_content = REPLACE(post_content, 'href="https://your-domain.tld/app/uploads/', 'href="https://your-cdn-url.tld/');
UPDATE wp_posts SET post_content = REPLACE(post_content, 'src="https://your-domain.tld/app/uploads/', 'src="https://your-cdn-url.tld/');
UPDATE wp_posts SET post_content = REPLACE(post_content, 'https://your-domain.tld/app/uploads/', 'https://your-cdn-url.tld/');
-- Plugins/Themes that use wp_options to store settings like logo file, etc.
UPDATE wp_options SET option_value = REPLACE(option_value, 'https://your-domain.tld/app/uploads/', 'https://your-cdn-url.tld/');
--- VisualComposer custom CSS
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'https://your-domain.tld/app/uploads/', 'https://your-cdn-url.tld/') WHERE meta_key = '_wpb_shortcodes_custom_css';