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

Question

Question

how to identify orphaned .tif

asked on April 1, 2020

After using LF to migrate all contents of one (old) volume to a new volume, one .tif file (one page only of a multi-page document) and its accompanying .txt, .loc, and .lft files were left behind.  The old volume in both the LF admin console and through LF client searches believes it is completely empty.

Does anyone have a sql script or other utility to help identify this orphaned page?

0 0

Replies

replied on April 1, 2020 Show version history

You can use the SQL script provided in Locating File in Laserfiche based on File Path in Volume

Or here is a slightly easier query to get docid from volume file.  Just edit the first 3 SET values and then execute.

DECLARE @IsImage bit,
        @FileName varchar(10),
		@VolName nvarchar(63)

-- Edit the below 3 SET values
-- @IsImage Options
--  0 = No(Electronic Document), 1 = Yes(TIFF Image)
SET @IsImage = 0
-- copy the whole file name without extention
SET @FileName = '0000029B'
-- Copy the folder name of the folder that contains the 00 and e00 folders
Set @VolName = N'DEFAULT000001'

-- Do Not Edit Below This Point
DECLARE @iFileName int,
		@hexstr nvarchar(10),
		@hex char(1),
		@i int,
		@place bigint,
		@a bigint
    -- Get integer value from File Name
    SET @hexstr = '0x' + @FileName
    SET @i = LEN(@hexstr) 
	SET @place = CONVERT(bigint,1)
    SET @a = CONVERT(bigint, 0)

    WHILE (@i > 0 AND (SUBSTRING(@hexstr, @i, 1) like '[0-9A-Fa-f]')) 
     BEGIN 
        SET @hex = SUBSTRING(@hexstr, @i, 1) 
        SET @a = @a + 
    CONVERT(bigint, CASE WHEN @hex LIKE '[0-9]' 
         THEN CAST(@hex as int) 
         ELSE CAST(ASCII(UPPER(@hex))-55 AS int) END * @place)
        SET @place = @place * CONVERT(bigint,16)
        SET @i = @i - 1
    
     END 
SET @iFileName = CONVERT(int, @a)


If (@IsImage = 1)
  BEGIN
    SELECT [dbo].[doc].[tocid] AS [EntryID]
    FROM [dbo].[doc]
    INNER JOIN [dbo].[toc]
    ON [dbo].[doc].[tocid] = [dbo].[toc].[tocid]
    INNER JOIN [dbo].[vol]
    ON [dbo].[toc].[vol_id] = [dbo].[vol].[vol_id]
    WHERE [dbo].[vol].[vol_name] = @VolName AND [dbo].[doc].[storeid] = @iFileName
  End
Else
  Begin
    SELECT [dbo].[toc].[tocid] AS [EntryID]
    FROM [dbo].[toc]
    INNER JOIN [dbo].[vol]
    ON [dbo].[toc].[vol_id] = [dbo].[vol].[vol_id]
    WHERE [dbo].[toc].[edoc_storeid] = @iFileName AND [dbo].[vol].[vol_name] = @VolName
  End

 

1 0
replied on April 1, 2020

The Volume Consistency Checker is supposed to do what you are asking.  However, I've had a thread that has gone unanswered for a couple of years about this utility not performing well and needing an update.

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

Sign in to reply to this post.