backdrop-contrib / backup_migrate

Port of the Drupal backup_migrate module to Backdrop
GNU General Public License v2.0
7 stars 14 forks source link

Error messages on restore and backup pages #81

Closed diannevolek closed 1 year ago

diannevolek commented 1 year ago

The restore and backup pages were showing errors. When I delete the info files in the backup folder, the files show.

I'm on PHP 7.4.

I have the same problem with the Drupal version (and in many cases the backups aren't working at all in Drupal due to errors. I am on 7.2 for most of my Drupal sites, and perhaps that is related to the issue).

diannevolek commented 1 year ago

FireShot Capture 022 - cPanel File Manager v3 - r144 websiteservername com The attached shows that backups had no file size. After I updated my Backdrop site and several modules, and updated to PHP7.4, it appears to work normally (I have never tested a restore).

diannevolek commented 1 year ago

I am backing up files, but I'm still not able to restore them (see image below). I assume this is a permissions issue? Should I need to ever restore the site, could we have something on the module that gives a process (e.g. take the backup file, place it here, unzip it here, it will restore x but won't restore Y, Restore the database first (or last).

I really, really miss the Drupal instructions where you could just do a Google search and get to a forum post of what had been tried on a specific module, what had failed, and what the community agreed was a good solution.

backupmigrate

argiepiano commented 1 year ago

@diannevolek are you selecting " Restore from an uploaded file"? And if so, are you selecting your file from your computer to be uploaded? And if so, what's your temporary directory at admin/config/media/file-system? Do you have writing privileges in that location?

Screen Shot 2023-05-23 at 3 44 13 PM
diannevolek commented 1 year ago

I don't get that choice? I back up the files using the FTP backup functionality to a cloud drive. When I click the "restore" tab, it gives this screen. Saved backups gives a similar error.

I've never got the Entire Site or Files Directory backups to work, I get a white screen eventually.

My hosting doesn't have a dev version.

Files appear in the FTP directory. It seems to create a few files each time? Today I have 8, so perhaps I did it twice by mistake? There are 4 info files, 2 mysql, and 2 tar.gz.

My file system settings are default - files, pvt and tmp.

FTP folder permission is 0777 pvt is 0755 tmp is 0777 - there are a lot of backup_migrate files here, including 4 from today that are not 0kb in size. None are .info files. files is 0775

argiepiano commented 1 year ago

There are known issues with backups of the entire site. It doesn't work well in Drupal either. It looks like you are trying to restore the entire site, rather than only the database?

When you restore, are you selecting "Restore to: Default Database"?

Screen Shot 2023-05-23 at 5 03 44 PM
argiepiano commented 1 year ago

OK, I'm re-reading your OP. It looks like you cannot even open the "Restore" UI, right?

This may be caused by some faulty configurations in the destinations or sources. Try going to admin/config/system/backup_migrate/settings and paste what you see there.

argiepiano commented 1 year ago

Also, in order to debug this problem, you should turn on "Error messages to display: All messages" so that we at least get a line number of where the error is happening. admin/config/development/logging

argiepiano commented 1 year ago

@diannevolek, I'm testing in my local installation of Backdrop, and I'm seeing the same exact bug!!! That's good news - it's the first step to fix the bug.

So, it looks like the problem is with the module, not your site. I'll try to get this fixed (though I'm not a maintainer...)

argiepiano commented 1 year ago

OK, I've done some debugging. The problem is very complex, and it affects backups done with FTP. Incidentally, the same issue exists in the Drupal version of Backup and Migrate - I was able to reproduce the error there too.

So, this may take a while to get fixed... In the meantime I'd suggest you don't use FTP to make backups. Can you make backups in a server folder outside your public_html folder? That seems to work fine.

diannevolek commented 1 year ago

Thank you so much! I don't need to use FTP, it just convenient so I can check on multiple sites at once.

I have about six D7 websites left, and I've never got backups to work on any of them, at any time (download or FTP). I've always assumed it was me. I live in fear every time I update!

argiepiano commented 1 year ago

You can have several sites backing up to the same folder in your server. I do that all the time. That allows you to check and access backups for several sites in one location. It's not hard to set up. Be sure to set up a private file system under /admin/config/media/file-system. This system path may look like ../../private. You may need fewer or more dots depending on the depth of your folder where Backdrop is installed. Be sure to create that "private" folder before setting the private file path.

Then simply use the Schedule or Manual destinations when you create backups.

argiepiano commented 1 year ago

OK, I've pinpointed the bug and will submit a PR.

argiepiano commented 1 year ago

PR created: #82.

I don't know how active the maintainer is, but hopefully someone in the @backdrop-contrib/bug-squad will be able to review and merge this soon.

How to reproduce the problem:

  1. Set up an FTP Destination in admin/config/system/backup_migrate/settings/destination/add (be sure credentials are correct etc)
  2. Create a backup to that destination at admin/config/system/backup_migrate
  3. Click the Restore tab and see the error described by the OP

What's happening: when retrieving the file names from the FTP server, the server returns names that start with ./backup-file.mysql.gzip.info etc. That initial period-slash creates issues for the temporary files created in the local, which are used for listing the available files.

The PR simply removes that initial ./ if it's there.

argiepiano commented 1 year ago

Pinging @quackers8me

quackers8me commented 1 year ago

Thank you @argiepiano for the fix and @diannevolek for reporting this. I have merged and created a new release which should show up in Backdrop modules update shortly. I am no longer active in the Backdrop community so welcome anyone interested in maintaining this module.

argiepiano commented 1 year ago

Thanks for the quick response, @quackers8me! I'll submit a PR to become comaintainer.