Solution for database version control and deployment?

Here are two possible solutions, both of these are actually generic MySQL version control tools but can be adapted to your workflow: dbv.php This tool creates “migrations”, which are basically SQL scripts, from the changes detected on the database. These scripts are stored in a local directory and thus can be commited to your current … Read more

How to migrate subsite from dev multisite to production multisite

This can be somewhat tedious, but hopefully this helps. The less that changes from one environment to the next, the less painful this process will be. Particularly, if the domain, site id, file paths remain the same, the less painful this process will be. This post assumes some knowledge of database management. It is not … Read more

Fastest way (least amount of steps) to locally import a remote database using WP-CLI

Since WP-CLI 0.24.0 you can now use aliases which enable you to import a remote database quite easily. By using aliases, you can run WP-CLI commands against another WP-CLI install. That install could be a remote machine. With this in mind I’ve hacked together a bash alias that chains together several WP-CLI commands to pull … Read more

Programmatically get images by URL and save in uploads folder

There’s actually a great function that will do all three of those things for you: media_sideload_image( $url, $post_id, $description ); The first argument is the remote url of the image you want to download. The second argument is the post id of the post to which you want to attach the image. The third argument … Read more