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

Question

Question

Export Volumes using SDK

SDK
asked on September 7, 2022

I'm trying to export Laserfiche volumes to a drive for offsite backup.  If I use the RepositoryAccess library, one of my volumes errors out: Laserfiche.HttpClient.HttpException: Error reading HTTP response body.  The volume contains a lot of large pdfs.  The error doesn't happen on all volumes.  I tried a the same export using LFSO104Lib and no error.  I'd rather use RepositoryAccess since it appears more straight forward to me.  Any ideas on what I would need to do to eliminate the error?

 

// *** RepositoryAccess ***

foreach (var volume in Laserfiche.RepositoryAccess.Volume.EnumAll(session))
{
    VolumeExportSettings volumeSettings = new VolumeExportSettings();
    volumeSettings.Path = Path.Combine(@"C:\lfexport\", volume.Name);
    volumeSettings.CopyFiles = true;
    volumeSettings.VolumeFormatVersion = VolumeFormatVersion.Version8;

    LongOperation longOp = volume.Export(volumeSettings);

    int writeCount = 0;
    while (longOp.IsCompleted != true)
    {

        Thread.Sleep(1000);
        longOp.Refresh();
    }
}

 

// *** LFSO104Lib ***

ILFCollection AllVols = (ILFCollection)db.Database.GetAllVolumes();
for (int i = 1; i < AllVols.Count; i++)
{
    string EXPORT_DIRECTORY = Path.Combine(@"C:\lfexport\", volume.Name);

    LFVolume Vol = (LFVolume)AllVols[i];
    LFProgress progress;
    
    if (Vol.Name.Contains(exportDate))
    {
        progress = Vol.Export(EXPORT_DIRECTORY + Vol.Name, true, Export_Version.EXPORT_VERSION_8);
        while (!progress.IsComplete)
        {
            progress.Refresh();
        }
    }

}

0 0

Replies

replied on March 1, 2023

Which line throws that exception? It seems like it could be a timeout, is the error thrown after a predictable amount of time?

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

Sign in to reply to this post.