Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Composer doesn't allow to install this module along backup_migrate v5
Steps to reproduce
composer require drupal/backup_migrate:^5@rc drupal/backup_migrate_flysystem
Proposed resolution
Change dependencies in info.yml file
Remaining tasks
Check that the functionality works by running the tests
I'm not aware of the breaking changes that the 5.0-rc release introduces so I am not sure it will work out of the box.
Comment | File | Size | Author |
---|
Comments
Comment #3
JonMcL CreditAttribution: JonMcL commentedI went with "^4 || ^5"
This should allow you to install version 5 of backup_migrate without forcing it onto others. Version 5 is still not the recommended release for backup_migrate and I haven't really done enough testing.
To install backup_migrate version 5.0.0-rc1 into your site, use:
composer require 'drupal/backup_migrate:^5.0'
Comment #4
rodrigoaguileraSweet. Thanks!
Comment #5
rodrigoaguileraSo the latest release allowed me to test this module alongside backup_migrate 5 and I discovered that there is changes in the namespaces so the module produces fatal errors.
I attach the patch to solve those but from a maintainers point of view I don't know how feasible is to maintain compatibility without using ugly ifs for the
use
statements.Probably the best is to revert this and release a 2.0.x branch with the changes for v5 compatibility.
Thanks for the cool module and your efforts!
Comment #6
rodrigoaguileraI left some parts without editing
Comment #7
JonMcL CreditAttribution: JonMcL commentedI knew I needed to do some real testing :)
There are also 2.0.x branches now for the Flysystem modules. I was going to create a new branch to properly support them as well.
I will try and get something committed in the next few days. In the meantime, I will revert the backup_migrate 5.0.x compatibility in composer.json.
Comment #8
rodrigoaguileraAaand the latest patch that actually saves the file :)
The only problem I noticed is it doesn't save the metadata (.info file) because the whole saveFile is overridden.
In the meantime I realized I don't even need this module because flysystem already defines stream wrappers that I can use with the "Server File Directory" destination of backup_migrate and it works perfectly. Maybe that is worth mentioning in the description of the module.
Thanks for all the support, I hope the patches are useful
Comment #9
rodrigoaguileraHmmm, using just the wrapper lead me to a lot of seek errors so I went back to this module.
There is more calls to underscore methods that I ignored. With this changes is able to read files from a directory.
Comment #10
JonMcL CreditAttribution: JonMcL commentedThank you for all the patches so far. I do plan to work on this in the coming days, but might not have a release ready for at least a week.
Yes, I found that the standard stream wrappers created by Flysystem didn't work out and that's why this module was created.
So far I've found some changes with the Backup and Migrate classes and plugins definitions. Some of it might require changes to this module's plugin implementations.
Have you considered just using Backup and Migrate v4? Or is there a v5 requirement that you have?
Comment #11
rodrigoaguileraMainly for D9 compatibility
Comment #12
JonMcL CreditAttribution: JonMcL commentedOf course. That makes sense. I forgot that v4 isn't compatible.
Comment #13
fjgarlin CreditAttribution: fjgarlin as a volunteer and commentedHi, I'm attempting to update to Drupal 9 and I see that the progress on this got kind of stuck and a change was even reverted, forcing to backup_migrate version 4.1.
Is there any progress on a 2.x branch and fully D9 compatible version?
I'll try to put something together with the above patches and the suggestions about versions, etc. but wanted to know if there was any other update that I'm not aware of.
Thanks.
Comment #14
fjgarlin CreditAttribution: fjgarlin as a volunteer and commentedComment #15
fjgarlin CreditAttribution: fjgarlin as a volunteer and commentedMostly the above patch by @rodrigoaguilera, together with the Rector fixes, but I also changed some annotations and the requirements on the info and json files.
Comment #16
fjgarlin CreditAttribution: fjgarlin as a volunteer and commentedComment #17
JonMcL CreditAttribution: JonMcL commentedAhh screw it .. "We'll do it live!" :)
Everything appears to be working EXCEPT you can't rely on the restore buttons that appear on the "Saved Backups" page. At least with S3 buckets, it's not working. You must download the backup file first and then you can use the standard "Restore" page and upload the file.
Comment #18
fjgarlin CreditAttribution: fjgarlin as a volunteer and commentedGreat, this will make the whole D9 upgrade much easier. Thanks.