Skip to content

Possibly use wp-cli to load the database and find-replace prod urls #75

Description

@joemaller

wp-cli can load daatabases and set themes. This is a simpler way of setting up the local dev DB than the MySQL commands we're using now.

wp db reset --yes 

wp db import dumpfile.sql

wp search-replace 'https://www.prod.com' 'http://localhost:8080/dev' --all-tables --skip-columns=guid --precise --recurse-objects --verbose

wp cache flush  

For replacing URLs, the prod URL should be read from wp-options if possible, to avoid having to configure it every time. That would be especially annoying switching between prod/staging on a single project. This might be complicated because our Wordpress docker image overrides WP_HOME and WP_SITEURL in src/wp-config-extra.php.

Note #73 we should be able to use wp from the main WordPress container, hopefully dropping the wp-cli section of the docker-compose file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions