Restoring a deleted collection

192 views
Skip to first unread message

Sean Carte

unread,
Feb 15, 2022, 5:35:54 AM2/15/22
to DSpace Technical Support
Is it possible to restore a deleted collection? This is on DSpace 6. We do have backups of the database.

Sean

Tim Donohue

unread,
Feb 15, 2022, 10:40:02 AM2/15/22
to DSpace Technical Support
Hi Sean,

Unfortunately, it's not at all easy to restore a single Collection from a database backup.  But, here's a few other options to consider:

If you happened to also do a recent AIP backup, then that's much easier, as you can just restore the Collection by reimporting its AIP(s) in restore mode: https://wiki.lyrasis.org/display/DSDOC6x/AIP+Backup+and+Restore#AIPBackupandRestore-Restoring/ReplacingusingAIP(s)

Another option would be to see if you can just restore the entire database from that backup (which can result in data loss if you've added new data since that last backup occurred). If you restore the database though, you'd also likely need to restore the "[dspace]/assetstore" folder from a backup at the same time (as any Item's files that were deleted from that assetstore folder during the Collection deletion would also require restoring).

A third option, if you have a backup of the database & assetstore folder from around the same time would be to use those to spin up a separate *test* instance of your DSpace site, with the same data as that last backup.  Then you could do an AIP backup of the deleted Collection at that point in time, and use the AIP tools to then restore it into your production DSpace  (make sure to fully test the restoration though before running it against your production site)

My recommendation would be to go with one of those approaches, when possible.  Restoring a single collection from a database backup would be highly complex to do at the database level....as it essentially would require somehow restoring the necessary deleted columns to several tables at once.  It's something even I've never done before.

Good luck,

Tim

Sean Carte

unread,
Feb 16, 2022, 12:55:20 AM2/16/22
to Tim Donohue, DSpace Technical Support
Thanks, Tim. That's very helpful.

Sean

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/57e9c19f-f341-4990-a9da-2ad20f87cc31n%40googlegroups.com.

Sean Carte

unread,
Feb 22, 2022, 2:40:19 AM2/22/22
to Tim Donohue, DSpace Technical Support
Hi Tim

I went with the third option and have spun up a test instance from a backup before the collection was deleted, but I can't get the AIP packager to work recursively on the collection; I get: exception; no such file or directory.

If I try a single item from that collection it works:

 /dspace/bin/dspace packager -d -a -t AIP -e sean....@gmail.com -i 10413/20198 20198.zip

Disseminating DSpace ITEM [ hdl=10413/20198 ] to 20198.zip

Also disseminating all child objects (recursive mode)..
This may take a while, please check your logs for ongoing status while we process each package.

CREATED a total of 1 dissemination package files.

Would you like to view a list of all files that were created? [y/n]: y



CREATED package file: /dspace/20198.zip


But not for the collection:

/dspace/bin/dspace packager -d -a -t AIP -e sean....@gmail.com -i 10413/6680 6680.zip

Disseminating DSpace COLLECTION [ hdl=10413/6680 ] to 6680.zip

Also disseminating all child objects (recursive mode)..
This may take a while, please check your logs for ongoing status while we process each package.
Exception: No such file or directory
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(File.java:2063)
at org.dspace.content.crosswalk.RoleCrosswalk.disseminateElement(RoleCrosswalk.java:190)
at org.dspace.content.packager.AbstractMETSDisseminator.crosswalkToMetsElement(AbstractMETSDisseminator.java:1356)
at org.dspace.content.packager.AbstractMETSDisseminator.makeMdSec(AbstractMETSDisseminator.java:626)
at org.dspace.content.packager.AbstractMETSDisseminator.addToAmdSec(AbstractMETSDisseminator.java:739)
at org.dspace.content.packager.AbstractMETSDisseminator.addAmdSec(AbstractMETSDisseminator.java:765)
at org.dspace.content.packager.AbstractMETSDisseminator.makeManifest(AbstractMETSDisseminator.java:862)
at org.dspace.content.packager.AbstractMETSDisseminator.writeZipPackage(AbstractMETSDisseminator.java:334)
at org.dspace.content.packager.AbstractMETSDisseminator.disseminate(AbstractMETSDisseminator.java:271)
at org.dspace.content.packager.DSpaceAIPDisseminator.disseminate(DSpaceAIPDisseminator.java:165)
at org.dspace.content.packager.AbstractPackageDisseminator.disseminateAll(AbstractPackageDisseminator.java:102)
at org.dspace.app.packager.Packager.disseminate(Packager.java:642)
at org.dspace.app.packager.Packager.main(Packager.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)


I have tried other collection handles with the same result. And a sitewide export also fails with the same error.

Any ideas where I've gone wrong?

Sean

On Tue, 15 Feb 2022 at 17:40, 'Tim Donohue' via DSpace Technical Support <dspac...@googlegroups.com> wrote:
--

Tim Donohue

unread,
Feb 22, 2022, 10:41:20 AM2/22/22
to Sean Carte, DSpace Technical Support
Hi Sean,

Based on that error, it appears it cannot find your system's "temp" directory, which is needed to built the AIPs. Usually, a Java install has a default "java.io.tmpdir" which will be used.  

But, you can also override it by setting "upload.temp.dir" in your dspace.cfg/local.cfg.  So, if you make sure "upload.temp.dir" points to a valid temp location (used to build/process AIPs) then that should hopefully get you past that error.

Tim

From: Sean Carte <sean....@gmail.com>
Sent: Tuesday, February 22, 2022 1:40 AM
To: Tim Donohue <tim.d...@lyrasis.org>
Cc: DSpace Technical Support <dspac...@googlegroups.com>
Subject: Re: [dspace-tech] Re: Restoring a deleted collection
 

Sean Carte

unread,
Feb 22, 2022, 1:43:24 PM2/22/22
to Tim Donohue, DSpace Technical Support
That worked beautifully; thanks, Tim!

I'll tackle the restoring part tomorrow.

Sean

Sean Carte

unread,
Feb 27, 2022, 12:25:59 AM2/27/22
to Tim Donohue, DSpace Technical Support
Thanks again, Tim. Everything worked perfectly thanks to your assistance.

Sean
Reply all
Reply to author
Forward
0 new messages