welaika / wordmove

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

Issue with links when pushing to server #256

Closed g33kidd closed 8 years ago

g33kidd commented 8 years ago

I've done the whole, wordmove push -t && wordmove push -p && wordmove push -d stuff, but I'm having an issue on the deployed server.

When navigating around the site, I notice most of the links including the admin login are still what I'm using for localhost.

For example:

My staging server is something.something.com and my localhost is localhost:8080. When I push the database to the staging server and go to something.something.com/wp-admin it redirects me to localhost:8080/wp-admin.

Has anyone else has this problem?

halvardos commented 8 years ago

Hi, this is probably a problem with the formatting of your Movefile, e.g a missing backslash in the localhost address resulting in WordMove not finding the exact string. Look in your database for the localhost entry in table: wp_options -> site_url field.

Copy this string and compare it to your Movefile.

If this does not work, please paste your Movefile here and remove any sensitive information :)

g33kidd commented 8 years ago

Thanks! I've used wordmove previously for projects, but have not had a problem. I'm probably sure I forgot to change something or am missing something.

Here's my Movefile with some redacted information:

local:
  vhost: "http://vhost.local"
  wordpress_path: "~/Developer/sites/<folder>" # use an absolute path here

  database:
    name: "website"
    user: "root"
    # password: ""
    host: "127.0.0.1"

production:
  vhost: "http://site.host.com"
  wordpress_path: "/public_html/<folder>" # use an absolute path here

  database:
    name: "name"
    user: "user"
    password: "password"
    host: "localhost"
    # port: "3308" # Use just in case you have exotic server config

  exclude:
    - ".git/"
    - ".gitignore"
    - ".sass-cache/"
    - "node_modules/"
    - "bin/"
    - "tmp/*"
    - "Gemfile*"
    - "Movefile"
    - "wp-config.php"
    - "wp-content/*.sql"

  # paths: # you can customize wordpress internal paths
  #   wp_content: "wp-content"
  #   uploads: "wp-content/uploads"
  #   plugins: "wp-content/plugins"
  #   themes: "wp-content/themes"
  #   languages: "wp-content/languages"
  #   themes: "wp-content/themes"

  # ssh:
  #   host: "host"
  #   user: "user"
  #   password: "password" # password is optional, will use public keys if available.
  #   port: 22 # Port is optional
  #   rsync_options: "--verbose" # Additional rsync options, optional
  #   gateway: # Gateway is optional
  #     host: "host"
  #     user: "user"
  #     password: "password" # password is optional, will use public keys if available.

  ftp:
    user: "redacted"
    password: "nope
    host: "server"
    passive: true

# production: # multiple environments can be specified
#   [...]
halvardos commented 8 years ago

What you should do is make sure you have the exact correct information on the second line:

vhost: "http://vhost.local" is the same as in the wordpress db, and that you are not missing a trailing slash or something like that.

g33kidd commented 8 years ago

Aha, thanks so much! I guess this is the first project I've had to push the database, so that would make sense I didn't change that last time. This worked! 😃