welaika / wordmove

Multi-stage command line deploy/mirroring and task runner for Wordpress
https://wptools.it/wordmove
MIT License
1.87k stars 165 forks source link

DB dump not updating urls #234

Closed samsfisher closed 6 years ago

samsfisher commented 8 years ago

Hi, Whenever i try to push my local site to dev or production site the site url is not being updated. I need to go tot he server to degine the site_url and home after each upload. Is this a bug? or am i doing something wrong?

JoshRiser commented 8 years ago

I am currently having this problem. Does anyone know what the problem is? I have experienced this in the past and I'm sure sure what I did to fix it.

cjke commented 8 years ago

Ditto - same here. Was working though, so not sure what I am doing different. Want to confirm nothing has changed on the repo end

EDIT: Just figured out what it was. My vhost for the production didn't match what was already there. So if you db entry is www.example.prod.com the vhost option in the movefile must match exactly that, so www.example.prod.com not www.example.prod.com/

rotexhawk commented 8 years ago

I have this issue only with pull. When the database is pushed the URLs are changed but pull doesn't update the URLs. It does pull the new information though.

mukkoo commented 8 years ago

I'll try to help you. WordMove try to change the exact match of vhost in both directions (pull and push). We suggest you to use always hostnames without final /.

Reopen the issue if needed.

dezinerdudes commented 8 years ago

So its seems I need to reopen the issue. Wordmove does update the urls according to the vhost set in the Movefile. However, it wont change any related urls. So for instance if my production vhost is https://www.example.com it will replace all instance of that in the dump. However, it will not replace instance of www.example.com without the https://

What is the solution for this, as this is causing issues for me :(

alessandro-fazzi commented 8 years ago

@dezinerdudes if that is the scenario, the solution could be to use www.example.com as the vhost entry in your Movefile.

But...as I said in another issue of yours, Wordmove shouldn't be use to replace arbitrary string, but just the domain URLs. For instance: if inside your posts you have a link such as

<a href="http://www.example.com/page">read my page at www.example.com/page</a>

where example.com is your site itself, we consider the right action to replace only the URL part of your code inside the href and leave alone the text.

Take a moment to make your scenario and your needs clearer and than, please, continue or close this issue as per your needs.

Cheers

dezinerdudes commented 8 years ago

Ok, super, thank you.

kingluddite commented 8 years ago

Had the same problem and fixed it this way:

  1. Deleted WordMove file and used $ wordmove init
  2. I re-added my settings with meticulous detail to spacing
  3. I added a / at the end of my local vhost value in WordMove
  4. I was also using staging and added / at the end of the path in staging section of WordMove file
  5. When I installed WordPress on my remote host, I used WP-CLI
  6. I used $ vv create to install WordPress locally in my VVV.
  7. I deleted all my local database tables and did `$ wordmove pull -e staging -d

I looked at my local db and saw that the path was correct this time (my problem was it was going to the staging site when I clicked on the local URL. The URLs were not changing with WordMove Even thought I could now see the URLS were changing in my DB I was still getting the redirect.

Refresh browser/clear cache

I hit cmd + r to clear my cache and the local and remote sites were working properly and WordMove was obviously changing the URL paths correctly.

Hope this helps someone else. I wasted 2 hours trying to figure it out.

WordMove is a beautiful thing but it is very finicky.

alessandro-fazzi commented 8 years ago

Isn't SHIFT+CMD+R the right shortcut to re-load with cache clearing?

Anyway thanks for your detailed report @kingluddite