You are viewing limited content. For full access, please sign in.

Question

Question

Restoring recycle bin from backup

asked on February 28, 2022 Show version history

We need to restore documents from backup (client deleted them and now want them back).  I have located where the SQL metadata is stored, but I need to know where the source documents might reside.  Is there a setup screen where this may have been configured?

Also ... we plan to restore these documents to our test server and then download them and import into our LIVE system.  In your experience, can this be done?

 

Update:  We learned from our VAR that this selected restore cannot be done.  We could restore the entire repository and then pull out what we need though.  With the zillions of docs in the repository we opted not to do this and instead are considering increasing the number of days that docs stay in the repository.

 

0 0

Replies

replied on March 4, 2022

You can Query the Windows paths from the restored DB, but the biggest problem will be knowing what the EntryIDs are for all documents in the recycle bin.  When you browse the Recycle Bin, you only see top level items, so you cannot browse into folders.

 

First restore the Repository DB to another SQL instance.  I would then set up a temp LF Server and attach the Repository using the restored DB (no documents will be available since the volumes will not be restored).  Now you should be able to log into the restored DB and browse the structure.

 

Now in the restored repository, restore all entries (this will not work for deleted pages) in the Recycle Bin, but to a folder of your choosing rather than the original location.  Now that you have the entries restored to a folder of your choosing, you can then easily find the EntryIDs for all documents within the restore folder.  Once you have the EntryID, you can produce the Windows paths using something like:

DECLARE @entryID INT;
SET @entryID = 74274; -- 69260;

IF OBJECT_ID('tempdb..#DocInfoTable', 'U') IS NOT NULL
/*Then it exists*/
DROP TABLE #DocInfoTable;

CREATE TABLE #DocInfoTable (
DocumentName nvarchar(255),
PageNum int,
FullPathAndFilename nvarchar(max)
);

INSERT INTO #DocInfoTable
SELECT dbo.toc.name AS DocumentName, dbo.doc.pagenum + 1 AS PageNum,
    dbo.vol.fixpath + '\' + 
	SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2),1,2) + '\' + 
	SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2),3,2) + '\' +
	SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2),5,2) + '\' +
	CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), dbo.doc.storeid),2) + '.TIF' AS FullPathAndFilename
FROM dbo.toc 
LEFT JOIN dbo.doc ON dbo.doc.tocid = dbo.toc.tocid
LEFT JOIN dbo.vol ON dbo.toc.vol_id = dbo.vol.vol_id
WHERE dbo.toc.tocid = @entryID
ORDER BY dbo.doc.pagenum;

INSERT INTO #DocInfoTable
SELECT TOP (1) dbo.toc.name AS DocumentName, null AS PageNum,
    dbo.vol.fixpath + '\e' + 
	SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), edoc_storeid),2),1,2) + '\' + 
	SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), edoc_storeid),2),3,2) + '\' +
	SUBSTRING(CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), edoc_storeid),2),5,2) + '\' +
	CONVERT(VARCHAR(8),CONVERT(VARBINARY(4), edoc_storeid),2) + '.' + edoc_ext AS FullPathAndFilename
FROM dbo.toc 
LEFT JOIN dbo.doc ON dbo.doc.tocid = dbo.toc.tocid
LEFT JOIN dbo.vol ON dbo.toc.vol_id = dbo.vol.vol_id
WHERE dbo.toc.tocid = @entryID
ORDER BY dbo.doc.pagenum;

SELECT * FROM #DocInfoTable WHERE [FullPathAndFilename] IS NOT NULL;

IF OBJECT_ID('tempdb..#DocInfoTable', 'U') IS NOT NULL
/*Then it exists*/
DROP TABLE #DocInfoTable;

Please note that the edocs are often/usually stored without an extension and that the LD document may have 1, 2, or 3 files associated and does not necessarily have a TIFF image.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.