welaika / wordmove

Multi-stage command line deploy/mirroring and task runner for Wordpress

Home Page:https://wptools.it/wordmove

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom wp-content path outside of wp core not working

nghh opened this issue · comments

commented

Hi,

this is my folder structure

|-movefile.yml
|-wwwroot
|--content # my custom wp-content folder
|---themes
|---uploads
|---plugins
|--wp # wordpress core folder
|--wp-config.php

a wordpress core push is working perfectly fine

wordmove push -e staging -w

but none of the wp-content pushes are working for me
e.g.:

wordmove push -e staging -u

gives me:

▬▬ Pushing Uploads ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
   remote | put_directory: /Users/me/Sites/clients/client/wwwroot/wp /vhosts/domain/subdomains/dev/wwwroot/wp /../content/* /../* .git/ .gitignore .gitmodules .envnode_modules/ bin/ tmp/* Gemfile* Movefile movefile movefile.yml movefile.yaml wp-config.php wp-content/*.sql.gz *.orig /* /../content/uploads/ /../content/ /../
    ℹ️  info | rsync --progress -e 'ssh onside' -rlpt --compress --omit-dir-times --delete --include /../content/uploads/ --include /../content/ --include /../ --exclude /../content/\* --exclude /../\* --exclude .git/ --exclude .gitignore --exclude .gitmodules --exclude .env --exclude node_modules/ --exclude bin/ --exclude tmp/\* --exclude Gemfile\* --exclude Movefile --exclude movefile --exclude movefile.yml --exclude movefile.yaml --exclude wp-config.php --exclude wp-content/\*.sql.gz --exclude \*.orig --exclude /\* /Users/me/Sites/clients/client/wwwroot/wp/ :/vhosts/domain/subdomains/dev/wwwroot/wp
building file list ...
1 file to consider

sent 361 bytes  received 20 bytes  254.00 bytes/sec
total size is 0  speedup is 0.00

but i do have some files in content/uploads

pushing DB gives me this error:

local | wp search-replace https://client.local/wp http://dev.client.com/wp --quiet --skip-columns=guid --all-tables --allow-root
Error: This does not seem to be a WordPress installation.

last but not least:

wordmove doctor

gives me following error

Validating movefile section: local ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ❌  error | [/paths] key 'paths:' is undefined.

anyone can help me?
thx jan

movefile.yml

local:
  vhost: https://client.local/wp
  wordpress_path: /Users/me/Sites/clients/client/wwwroot/wp
  
  paths:
    uploads: ../content/uploads
    plugins: ../content/plugins
    themes: ../content/themes

staging:
  vhost: https://dev.client.com/wp
  wordpress_path: /vhosts/domain/subdomains/dev/wwwroot/wp
  
  paths:
    uploads: ../content/uploads
    plugins: ../content/plugins
    themes: ../content/themes

wp-config.php

define('WP_SITEURL', 'https://client.local/wp');
define('WP_HOME', 'https://client.local');

I have the same problem. Anybody knows a solution? I have dist folder for my theme, but I cant specify it in wordmove.yaml file at the local part. I got the same error and when I try to push my theme, wordmove push it into wrong path.

I tried to search for the problem. In version 3.0.0 there is no error for local paths in the movefile. If I update to 3.1.0 the movefile gets this error again: [/paths] key 'paths:' is undefined. Can anybody solve the problem? I cant use version newer than 3.0.0

@nghh my opinion is that you are running wordmove from your project's root; your project root is not your wordpress root. wordmove is calling the command wp search-replace from a path where wp can't recognise the wordpress position.

An improvement for Wordmove should be to call wp search-replace always passing the --path=/custom/or/default/wordpress/path.

But you can fix - if I'm right - the situation by writing a wp-cli.yml file in the same folder where movefile.yml is, containing

path: /Users/me/Sites/clients/client/wwwroot/wp

Moreover, I'm not sure Wordmove is able to correctly expand ../ path you're using in your paths section. Please try configuring theme like

<% local_path = '/Users/me/Sites/clients/client/wwwroot' %>
<% staging_path = '/vhosts/domain/subdomains/dev/wwwroot' %>

local:
  vhost: https://client.local/wp
  wordpress_path: <%= local_path %>/wp
  
  paths:
    uploads: <%= local_path %>/content/uploads
    plugins: <%= local_path %>/content/plugins
    themes: <%= local_path %>/content/themes

staging:
  vhost: https://dev.client.com/wp
  wordpress_path: <%= staging_path %>/wp
  
  paths:
    uploads: <%= staging_path %>/content/uploads
    plugins: <%= staging_path %>/content/plugins
    themes: <%= staging_path %>/content/themes

Realated to #513

Related to #407

I was saying

@nghh my opinion is that you are running wordmove from your project's root; your project root is not your wordpress root. wordmove is calling the command wp search-replace from a path where wp can't recognise the wordpress position.

An improvement for Wordmove should be to call wp search-replace always passing the --path=/custom/or/default/wordpress/path.

And now that improvement is shipped in the newer version. So no more need to use wp-cli.yml for this problem. So I'm going to close :)