Needs review
Project:
Backup and Migrate SFTP
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2014 at 03:15 UTC
Updated:
10 Sep 2021 at 12:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
MrSasquatch commentedDoes this project not do troubleshooting of issues? Is the project still maintained? I submitted my issue several days ago, and I have not seen so much as a comment. Just wondering if I should continue monitoring the issue or not. Please advise. Any help is greatly appreciated.
Comment #2
Leeteq commentedFYI - ref. this issue in the Backup_Migrate issue queue:
#622054: SSH/SFTP remote access
Comment #3
damienmckennaI suspect the module needs to be updated to the latest APIs.
Comment #4
rtdean93 commentedAny update on this?
Comment #5
sreher commentedThe listing of the sftp directory, also doesn't work in my installtion.
But I replace the ftp destination with the sftp for test reasons and that works.
So the code seems to be ok, but the listing of the new sftp destination is the problem.
In detail. There is a backup_migrate/includes/destinations.ftp.inc.
I replace this file with the backup_migrate_sftp/destinations.sftp.inc.
Rename the file name and the class name to backup_migrate_destination_ftp and it works.
Comment #6
alienseer23 commentedAny chance of a patch???
Comment #7
alienseer23 commentedI fixed it, but I don't do patches.
Here is the corrected code for the backup_migrate_sftp.module
and I changed line 15 in /destinations.sftp.inc
from this:
to this:
Enjoy :)
Comment #8
damienmckennaI rolled a patch based on @alienseer23's changes. I reverted his README.txt and .info changes, and changed the info file to require B_M v3.
Comment #9
alienseer23 commentedAny chance of getting this to the official repository, I'm sure that folks would appreciate that.
Comment #10
alienseer23 commentedIt would be great to get this patch rolled into the dev release, I've been using it for several months now with no problems, and it would be nice to stop having this show up as a necessary upgrade. Any chance of just putting it into the official repository, please?
Comment #11
damienmckenna@alienseer23: Thanks for the review. FYI the "Patch (to be ported)" issue queue status is to indicate that an existing patch needs to be ported to a different branch of the project, it isn't for saying "this works for me".
Comment #12
narendrarPatch worked for me also.
Comment #13
robertoperuzzoPatch #8 doesn't work in my project: Drupal 7.43, Backup & Migrate 3.1. (Yes, of course... I need to upgrade my core. I'm going to do it asap).
When I build the project using drush makefile, I get this error:
Unable to patch backup_migrate_sftp with backup_migrate_sftp-n2292199-8.patch. [error]I attach my patch.
Comment #14
cozzamara commentedAlso I need an update version to BM v3.
Comment #15
cozzamara commentedAfter 2 days of searching because the #7 works only on XAMPP on Windows and not on Ubuntu 16.04 I found the solution for both system:
in
destination.sftp.incfiles another modify has to do.at line 41 I had to change
$stream = @fopen("ssh2.sftp://$sftp/$path/$filename", 'w');with
$stream = @fopen("ssh2.sftp://".intval($sftp)."/$path/$filename", 'w');For the solutions I have to say thanks to https://docs.acquia.com/article/sftp-over-ssh2-error.
So the #7's modify are all right but another one is needed.
I test it and works right.
So all call where is used the Resource value need to be changed with intval() call.
So all are Line 41, 75, 81, 103, 120, 130
Comment #16
cozzamara commentedComment #17
damienmckennaPlease don't mark issues "fixed" until someone commits a change.
Comment #18
cozzamara commentedIf someone needs the modify I made, can use the attached version that works for me.
Comment #19
cozzamara commentedPlease test it
Comment #20
damienmckennaHere is @cozzamara's changes in patch format.
Comment #21
cozzamara commentedAnother change in file
destinations.sftp.incneeded.At line 16 the array
$supported_opsmust be modify from:to
So
'remote backup'needs to be added to the$supported_opsotherwise the SSH destination is not considered as Remote destination but just local destination.Comment #22
cozzamara commentedNo one did test my modify? So can someone commit a new release? Thanks.
The only negative points of this module is the compression time depends by SSH server connection speed.
A backup with ssh needs at least 10-15 minutes for my site.
Comment #23
cozzamara commentedJust another fix needed to avoid "Warning: stat(): stat failed for ssh2.sftp://8727/xxxxx/y/zzzzz20180521-21-05-2018T17-03-36.sitearchive.tar.gz.info in backup_migrate_destination_sftp->_list_files() (linea 131 di /var/www/aaaaaa/sites/all/modules/backup_migrate_sftp/destinations.sftp.inc)." when in destination folder there are other files.
On line 131 of destinations.sftp.inc replace
statfunction withssh2_sftp_statfunction.Comment #24
cozzamara commentedExcuse me but
ssh2_sftp_statneed 2 parameter so the right 131 line is:$stat = ssh2_sftp_stat(intval($sftp), "ssh2.sftp://".intval($sftp)."/$path/$file");I tested and no warnig appear in log.
Please can anyone confim?
Comment #25
cozzamara commentedExcuse me but
ssh2_sftp_statneed 2 parameter so the right 131 line is:$stat = ssh2_sftp_stat(intval($sftp), "ssh2.sftp://".intval($sftp)."/$path/$file");I tested and no warnig appear in log.
Please can anyone confim?
Comment #26
cozzamara commentedExcuse me but
ssh2_sftp_statneed 2 parameter so the right 131 line is:$stat = ssh2_sftp_stat(intval($sftp), "ssh2.sftp://".intval($sftp)."/$path/$file");I tested and no warnig appear in log.
Please can anyone confim?
Sorry for three post, I made a mistake
Comment #27
cozzamara commentedAnother change to 131 line:
$stat = ssh2_sftp_stat($sftp, "ssh2.sftp://".intval($sftp)."/$path/$file");because otherwise this warning appear:
Warning: ssh2_sftp_stat() expects parameter 1 to be resource, integer given in backup_migrate_destination_sftp->_list_files() (linea 131 di /var/www/mysites/sites/all/modules/backup_migrate_sftp/destinations.sftp.inc).
Comment #28
cozzamara commentedHello to everyone, I made another modify to the code to avoid php warning in log about
and
functions.
To solve I removed the line:
$data = fread($stream, filesize("ssh2.sftp://$sftp/$path/$file_id"));and I added this:
So I attach a new patch with all modification of this issue. I hope it is useful.
Comment #29
cozzamara commentedComment #31
robertoperuzzoDrupal: 7.82
Backup & Migrate: 3.5
I cannot apply patch #28 neither #29 using Drush makefile, so I created a new patch starting from #20. Here is the forked issue repo.