Needs review
Project:
Backup and Migrate
Version:
5.1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Dec 2017 at 00:55 UTC
Updated:
25 Mar 2025 at 20:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
damienmckennaThere's an existing issue which talks about the functionality for D7.
Comment #3
damienmckennaComment #4
damienmckennaComment #5
damienmckennaComment #6
damienmckennaComment #7
boehmrya commentedI'm going to give this a go.
Comment #8
mykola dolynskyiPostgre is not supported yet or present in dev branch of module?
Comment #9
boehmrya commentedNot currently. I'm working on a patch for this, but it's not quite ready yet.
However, If you think that you can put something together, by all means, go for it.
Comment #10
mykola dolynskyi@boehmrya thanks, I will use cloud drive snapshoting while
Comment #11
ruby232 commented@boehmrya I am interested in adding postgres support for Drupal 8, how can I collaborate.
I upload a pull request to https://git.drupalcode.org/project/backup_migrate?
Comment #12
damienmckennaIf you'd like to upload a WIP you need to do it using a patch file, drupal.org doesn't support pull requests yet.
Comment #13
damienmckennaThough honestly if you need help with it you could just upload a zip, tgz or other archive of your files, or even just upload the raw PHP files (after you rename them to e.g something.txt as you aren't allowed to upload files with a ".php" extension) and someone can build the relevant patch file for you.
Comment #14
boehmrya commentedComment #15
tongadall commentedYes please, as said in #13, upload as you can, we will try build the relevant patch.
Comment #16
damienmckennaMoving 8.x-4.x issues to 5.0.x because the older branch is no longer supported.
Comment #17
off commentedSubscribe
Comment #18
damienmckenna@OFF: Just so you know, you don't have to post a comment to "subscribe" to an issue, just click the "Follow" link on the right side of the page and you'll get an email any time a comment is posted.
Comment #19
maxasus123Hi, i try create plugin for PostgresQL,
But not work for restore.
It can be exported as sql.giz.
but when i restore it got error
Comment #20
infojunkieHow do I use this patch?
I have applied it to backup_migrate 5.0.1, and made sure the new files are created in the right places. When I go to Quick Backup at admin/config/development/backup_migrate, I only see in Backup Source the options "Private Files Directory" and "Public Files Directory".
ANSWER: Go to admin/config/development/backup_migrate/settings/source and add a Backup Source of type PostgreSQL Database.
Comment #21
infojunkieI'm submitting a different patch based on my testing of the patch above. The general idea is to avoid hand-generating and hand-importing SQL dumps, relying instead on
pg_dumpandpsqlrespectively. This reduces the maintenance surface to the minimum, at the cost of introducing a dependency on the official PostgreSQL client binaries.Also, there are some fixes compared to the first patch:
- The "Default Drupal Database" and "Entire Site" sources work as expected with PostgreSQL as the main database engine
- Any PostgreSQL database can be targeted in addition to the default Drupal database
- The exclude / no-data tables settings are honored
Comment #22
infojunkieSlight amendment to the above patch to capture stderr in case of errors and log it.
Comment #23
damienmckennaNew changes will be added to 5.1.x.
Let's see if the tests work on PGSQL.
Comment #24
damienmckennaThe tests aren'y working against PostgreSQL, so it needs a little work.
Comment #25
infojunkieDrupal 9 requires PgSQL 10+, but the test config seems to be running D9.4.x against PgSQL 9.5 - hence the error.
I'd be happy to adjust the test config, but I am not familiar with Drupal CI and I can't seem to login to Dispatcher.
Comment #26
damienmckennaFair point. I've started a test run against PHP 8.1 and PostgreSQL 10.12, we'll see how it works.
Comment #27
msxlrd commentedHi,
I've installed Backup and migrate (5.0 / 5.1.x-dev) on drupal 9.3.19 with PostgreSQL 11.17, using patch from comment #22.
I'm getting an drupal error after I clicked on the button to add additional settings under /admin/config/development/backup_migrate/settings:
The class Connection in file PostgreSQLSource.php seems to be undefined:
Besides that it seems to be working with postgres.
Do you have any idea?
Comment #28
damienmckennaI don't see why the Connection class needed to be renamed via the "use" statement, does it work without that?
Comment #29
infojunkieThe patch at #28 works for me, although I was not able to reproduce the error at #27, and I don't understand how the updated patch would solve the missing class error.