Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulling remote db not working #27

Closed
EvanHerman opened this issue Oct 14, 2016 · 6 comments
Closed

Pulling remote db not working #27

EvanHerman opened this issue Oct 14, 2016 · 6 comments

Comments

@EvanHerman
Copy link

EvanHerman commented Oct 14, 2016

I am attempting to pull a remote database and replace my local instance with it.

wp deploy pull production --what=db

The command runs, and everything seems to go through successfully, but the database on my local instance doesn't actually update.

I can see that the files were pulled from my remote database fine and stored in a /production_*/ directory. So something seems to be going wrong during the replacement. Not sure where to begin looking.

@csknk
Copy link
Collaborator

csknk commented Oct 14, 2016

Hi, you can get more info by adding define('WP_DEPLOY_DEBUG', true); to your config and repeating the pull.
Do you get a timestamped .sql file in your /production_*/ directory?
I just tested it and I'm not seeing the downloaded database (i.e. I have a problem too!)

@EvanHerman
Copy link
Author

@DavidCWebs,

I am getting the time stamped file but it's not importing properly. None of the table in my database updates. If I manually import the file using wp import db and specify that file, everything work fine. (Of course I still have to do a find and replace to update URLs).

With the WordPress deploy debug set to true, I see no errors during execution. Strange. I'll have to spend a little more time and see If can find anything else. As far as I know this project has been abandoned, so no future development will be taking place. I'm hoping it's just a setting on my end and nothing within the code itself.

@csknk
Copy link
Collaborator

csknk commented Oct 17, 2016

Hi @EvanHerman
What version of WP-CLI are you using?
What messages are you getting when it runs without debug turned on?
I've put myself forward to maintain this project but haven't been able to dig into it properly yet due to work pressure...I find it very useful so hopefully it's not abandoned!

@EvanHerman
Copy link
Author

EvanHerman commented Oct 18, 2016

@DavidCWebs I'm running version 0.24.0. I'll take a second look and report back here with my debug report

@EvanHerman
Copy link
Author

EvanHerman commented Oct 20, 2016

@DavidCWebs After doing some additional debugging, I was able to narrow down the issue to a few things. First, one of my paths in the config was not set exactly right - so the file wasn't being generated server side.

The second issue, and a much larger one - my local site instance URL is set to http://local-site.dev , and my external site was set to https://www.external-site.com.

During the db import (search and replace) the URL was being improperly replaced. For example, when I pulled my remote DB, during the search and replace https://www.external-site.com was being replaced with www.external-site.com, so my local site wasn't being setup properly. Not sure if this was due to an improper siteurl option, or what. Eventually I got this working.

I created a PR, which appends the scheme (http:// | https://) before returning the domain. It also checks that ['base'] is set and sanitizes the URL before returning it.

Not sure you have the power to merge things in, but the PR is there in case anyone else runs into a similar issue.

#29

All this to say that a few issues were causing me problems, and it wasn't one specific thing.

@csknk
Copy link
Collaborator

csknk commented Oct 21, 2016

Thanks @EvanHerman - sounds like a useful find on the search and replace. I'll check the PR this weekend.

@csknk csknk closed this as completed Oct 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants