Managing WP Migrate DB with ffraenz/private-composer-installer

Anyone using https://github.com/ffraenz/private-composer-installer to manage WP Migrate DB Pro?

Wanted to share my config in case it’s helpful.

I seem to have it working, having added to the site/.env (for local) and group_vars/staging/vault.yml (as an env variable), the key: WP_MIGRATE_DB_KEY with value of my Migrate DB Pro Key.

"repositories": [
     {
      "type": "composer",
      "url": "https://wpackagist.org"
    },
    {
	  "type": "package",
	  "package": {
		"name": "wp-migrate-db/wp-migrate-db-pro",
		"version": "5.8.0",
		"type": "wordpress-plugin",
		"dist": {
		  "type": "zip",
		  "url": "https://api.deliciousbrains.com/?wc-api=delicious-brains&request=download&licence_key={%WP_MIGRATE_DB_KEY}&slug=wp-migrate-db-pro&site_url=http://example.com"
		},
		"require": {
		  "composer/installers": "^1.4",
		  "ffraenz/private-composer-installer": "^2.0"
		}
	  }
	}
  ],

The require looks like this:

"require": {
    "php": ">=7.1",
    "composer/installers": "^1.4",
    "vlucas/phpdotenv": "^3.0.0",
    "oscarotero/env": "^1.1.0",
    "roots/wordpress": "5.2",
    "roots/wp-config": "1.0.0",
    "roots/wp-password-bcrypt": "1.0.0",
    "advanced-custom-fields/advanced-custom-fields-pro": "*",
    "wp-migrate-db/wp-migrate-db-pro": "*",
    "wp-migrate-db/wp-migrate-db-pro-media-files": "*",
    "wp-migrate-db/wp-migrate-db-pro-cli": "*",
    "wpackagist-plugin/custom-post-type-ui": "^1.5.7"
  }

And the other add-ons (the ones I have):

    {
	  "type": "package",
	  "package": {
		"name": "wp-migrate-db/wp-migrate-db-pro-media-files",
		"version": "1.4.14",
		"type": "wordpress-plugin",
		"dist": {
		  "type": "zip",
		  "url": "https://api.deliciousbrains.com/?wc-api=delicious-brains&request=download&licence_key={%WP_MIGRATE_DB_KEY}&slug=wp-migrate-db-pro-media-files&site_url=https://baughmanproperties.com"
		},
		"require": {
		  "composer/installers": "^1.4",
		  "ffraenz/private-composer-installer": "^2.0"
		}
	  }
	},
    {
	  "type": "package",
	  "package": {
		"name": "wp-migrate-db/wp-migrate-db-pro-cli",
		"version": "1.3.5",
		"type": "wordpress-plugin",
		"dist": {
		  "type": "zip",
		  "url": "https://api.deliciousbrains.com/?wc-api=delicious-brains&request=download&licence_key={%WP_MIGRATE_DB_KEY}&slug=wp-migrate-db-pro-cli&site_url=https://baughmanproperties.com"
		},
		"require": {
		  "composer/installers": "^1.4",
		  "ffraenz/private-composer-installer": "^2.0"
		}
	  }
	}

Something I’m not clear on is how to include the .env variables under group_vars/all/ so I don’t have to include them in each environment separately.

Happy Spring, friends.

Thanks for sharing this!

1 Like

Yes. Is see that group_vars/all/vault now has a new section which can be uncommented and hold custom shared key pairs as referenced above.

Did you know they had composer support already? If you did, what’s the benefit in using ffraenz’s tool?

1 Like

I had missed that. Thank you. Here’s a Roots Discourse link to an approach to that that seems to work.

This topic was automatically closed after 42 days. New replies are no longer allowed.