collective/collective.recipe.backup

small edge case when restoring

fredvd opened this issue · 0 comments

When I copy a backups/backups-blobs directory from a remote instance into my local development setup for a site and the filestorage/blobstorage directories don't exist yet in /var, repozo complains that it cannot write to the Data.fs because 'filestorage' is missing::

$ bin/restore 

This will replace the filestorage:
    <buildout-dir>/var/filestorage/Data.fs
This will replace the blobstorage:
    <buildout-dir>/var/blobstorage
Are you sure? (yes/No)? yes
INFO: Please wait while restoring database file: <buildout-dir>/var/backups to <buildout-dir>/var/filestorage/Data.fs
Traceback (most recent call last):
  File "<buildout-dir>/bin/repozo", line 23, in <module>
    sys.exit(ZODB.scripts.repozo.main())
  File "/Users/fred/.buildout/eggs/ZODB3-3.10.5-py2.7-macosx-10.9-x86_64.egg/ZODB/scripts/repozo.py", line 618, in main
    do_recover(options)
  File "/Users/fred/.buildout/eggs/ZODB3-3.10.5-py2.7-macosx-10.9-x86_64.egg/ZODB/scripts/repozo.py", line 588, in do_recover
    outfp = open(options.output, 'wb')
IOError: [Errno 2] No such file or directory: '<buildout-dir>/var/filestorage/Data.fs'
ERROR: Repozo command failed. See message above.
ERROR: Halting execution due to error; not restoring blobs.
fred@Tycho:vmm-engelsnieuw (svn:trunk?) $ ls var/fi
fred@Tycho:vmm-engelsnieuw (svn:trunk?) $ mkdir var/filestorage
fred@Tycho:vmm-engelsnieuw (svn:trunk?) $ bin/restore 

This will replace the filestorage:
    <buildout-dir>/var/filestorage/Data.fs
This will replace the blobstorage:
    <buildout-dir>/var/blobstorage
Are you sure? (yes/No)? yes
INFO: Please wait while restoring database file: <buildout-dir>/var/backups to <buildout-dir>/var/filestorage/Data.fs
INFO: Restoring blobs from <buildout-dir>/var/backups-blobs to <buildout-dir>/var/blobstorage
INFO: rsync -a  --delete <buildout-dir>/var/backups-blobs/blobstorage.0/blobstorage <buildout-dir>/var