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

Cannot PUSH database (FTP) #402

Closed colmandesilva closed 7 years ago

colmandesilva commented 7 years ago

I am having issues PUSHING the database to my server. I can pull which works perfectly. I get the following errors in the log: [12-Jun-2017 15:46:08 America/Chicago] PHP Warning: mysqli::mysqli(): (HY000/2005): Unknown MySQL server host 'localhost:3306' (0) in /home2/koalitio/public_html/rubicon/wp-content/import.php on line 403

[12-Jun-2017 15:46:08 America/Chicago] PHP Warning: mysqli::close(): Couldn't fetch mysqli in /home2/koalitio/public_html/rubicon/wp-content/import.php on line 942

As I mentioned pulling works so there is connection to the database. Just pushing that throws these errors.

EvansMatthew97 commented 7 years ago

@colmandesilva I think this is because you are using PHP version 5.5 or lower. The command works for PHP 5.6 and above for me, but not 5.5.

If you do not want to upgrade, you can do the following:

The "problem" lies in import.php.erb on line 50. You can find this file at [ruby_path]\lib\ruby\gems\2.4.0\gems\wordmove-2.1.2\lib\wordmove\assets

Change $db_server = '<%= escape_php db[:host] %>:' . $db_port; to $db_server = '<%= escape_php db[:host] %>';

alessandro-fazzi commented 7 years ago

Didn't know about the PHP version constraint; thanks for pointing that out @MrPutuLips , but could I ask you a reference?

i was investigating and i noticed that mysqli class (introduced in https://github.com/welaika/wordmove/commit/62bc75492fbfe461a6ee44953a73a8629f558de7 while updating 3rd party library) has a different constructor accepting port as a stand alone parameter.

I'm gonna publishing an update with the fix.

@colmandesilva I'm really glad you took the time to report the issue. For the next time just be sure to include some more helpful info in order to speed up the debugging process ;)

alessandro-fazzi commented 7 years ago

Closed by mistake

alessandro-fazzi commented 7 years ago

Please @colmandesilva @MrPutuLips there is a new 2.1.3 version in the wild. Test it out.

gem update wordmove
wordmove --version

in order to update and check.

Thanks in advance

colmandesilva commented 7 years ago

@MrPutuLips @pioneerskies Thanks for resolving this so swiftly! Apologies for not posting a properly detailed bug report. Will remember for the next time (hopefully there will be no need).

Also thanks for making this. Going to make updating WP sites so much easier.