collective / collective.recipe.backup

bin/backup script: sensible defaults around bin/repozo
https://pypi.org/project/collective.recipe.backup/
5 stars 7 forks source link

support to backup single database #18

Closed frisi closed 8 years ago

frisi commented 10 years ago

would be great to support a snapshot or backup of a single database w/o the need to provide a seaparate backup buildout section for these.

[backup]
recipe = collective.recipe.backup
additional_filestorages =
    foo ${buildout:directory}/var/filestorage/foo/foo.fs ${buildout:directory}/var/blobstorage-foo
    bar ${buildout:directory}/var/filestorage/bar/bar.fs

bin/backup -q foo should backup foo.fs and blobstorage-foo

open question: how to backup only the default Data.fs and blobstorage. maybe bin/backup default is fine, i'm open for suggetions though ;-)

mauritsvanrees commented 10 years ago

I don't see the need for this. If you regularly need this, a separate [foo-backup] section seems best. But a pull request would be fine.

bin/backup default seems fine. That could clash if one of the additional_filestorages is called default, which may need a warning. Possibly bin/backup Data would work. I wonder if using Data as additional_filestorage currently gives problems...

frisi commented 10 years ago

atm i don't have a regular need for this either. here is my usecase that made me feel like submitting this feature request is a good idea:

i'm having a zope instance with multiple plone sites, each using it's separate zeo mount point and blobstorage.

there is a development server for testing new releases and a production server for the final releases.

sometimes customers use the dev server to create content using types/addons only available on the dev server.

so rolling out the new release also means copy databases from the dev to production server.

using bin/snapshot for this seems a good idea, but having 4 other portals (one to four GB each) means using a lot of disk space and also wait some time.

mauritsvanrees commented 8 years ago

It's been two years. I have no plans to implement this. If you want to create a pull request for this, go ahead. Closing for now.

frisi commented 8 years ago

np @mauritsvanrees - thanks for cleaning up

just in case somebody has the same use case, here is what i'm using to backup single databases (bin/backup-one) - including the main Data.fs and blobstorage - see comments below why this is necessary

[backup]
recipe = collective.recipe.backup
enable_zipbackup = true

additional_filestorages =
    one ${buildout:directory}/var/filestorage/one.fs ${buildout:directory}/var/blobstorage-one
    two ${buildout:directory}/var/filestorage/two.fs ${buildout:directory}/var/blobstorage-two

[backup-one]
<= backup
# bin/backup -S option not implemented yet - see
# https://github.com/collective/collective.recipe.backup/issues/18

# the following is dangerous, because one database gets exported the same way as
# Data.fs would be if bin/backup was called! 
#blob-storage =  ${buildout:directory}/var/blobstorage-one
#datafs =  ${buildout:directory}/var/filestorage/one.fs
# using additional_filestorages prevents us from this possible failure
# drawback results in the main Data.fs and main blobstorage are beeing backed up multiple times

additional_filestorages = 
  one ${buildout:directory}/var/filestorage/one.fs ${buildout:directory}/var/blobstorage-one