Skip to content

Instantly share code, notes, and snippets.

View ultimagriever's full-sized avatar
🏠
Working from home

Pamela Argentino ultimagriever

🏠
Working from home
View GitHub Profile
<?php
// php -f export-aws-s3-wordpress.php <host> <db> <user> <password> <url> <bucket> [ --dry-run]
array_shift($argv);
list($host, $db, $user, $pass, $url, $bucket, $dryrun) = $argv;
$cmd = 'wp search-replace "' . $url . '/wp-content/uploads" "' . $bucket . '/wp-content/uploads" --url=' . $url . ' --network ' . $dryrun;
echo $cmd . PHP_EOL;
echo shell_exec($cmd) . PHP_EOL;