10up/wp-local-docker-v2

Bedrock WPSnapshot not working -- can't find wordpress

joseffb-mla opened this issue · 5 comments

When running the wpsnapshot command:

10updocker wpsnapshots create --repository docker-repo --path ~/wp-local-docker-sites/bedrock-test --db_host 127.0.0.1 --db_name bedrock-test --db_user wordpress --db_password password

it goes through interactive until it gets the error saying it can't find the word press install:

This is not a WordPress install. You can only create a snapshot from the root of a WordPress install.

I've tried going into the \wp directory as stated in another wpsnapshot ticket but it doesn't seem to work.

my directory structure is:

/site
--/wordpress
--/--/web/
--/--/--/wp ```

Keep in mind that 10updocker wpsnapshots is going to operate inside a docker container with a WORKDIR set to /var/www/html. WORKDIR is NOT the same as ~ which would be the user's home directory inside the container. If you specify the path as ~/wp-local-docker-sites you're actually telling it the path inside the container, not the path on your actual system.

Try this instead:

10updocker wpsnapshots create --path ./web/wp

As long as you run this command while in your project directory, and assuming you've already configured wpsnapshots before, you shouldn't need to specify any other connection details as it'll pick those up from the wp-config.php file.

Hope that helps.

This works to a point but then it can't find the db. keeping hte fact that the db is in a docker container as well, I changed the host to 'mysql' (the name of the container), away from 127.0.0.1 and it too does not work.

I went into the container shell and tried a mysql --host mysql -uwordpress -ppassword and it works.

experimenting with other combinations now. Any insight is appreciated. I will post a solution here if I find it.

seems the domain in ms-settings is coming up as localhost instead of site.test which is error-ing our in a db not found (via the ms_not_installed command). I'll check the snapshot docs to see if there is a way to spoof the $_SERVER['HTTP_HOST'] var via command line.

Hey @joseffb-mla

Sorry for the long delay in reply on this one. Please try the troubleshooting steps in the readme.

Let us know if you have questions or still having issues and we will reopen this issue. Thanks!