Where you can locate files in Telligent Community DB Server Site?
Where you can locate files in Telligent Community DB Server Site?
There are two file storage folders where you can find all files which is posted in Forums, Posts or in Replies of any discussion.
Root of Web Site --> Web\filestorage\telligent.evolution.components.attachments
Root of Web Site --> Web\filestorage\CommunityServer.Components.PostAttachments
You can find any upload in
Root of Web Site --> Web\filestorage\CommunityServer.Components.MultipleUploadFileManager
You can find Bread Crumb from below formula
Home >> Group Name >> Forum Name >> Thread Name
or
Home >> Group Name >> Parent Group Name >> Section Name >> Post Name
You can find below script to export CSV with all posts and links to file storage
clear
$ClientCSVPath = "C:\Users\$env:UserName\Documents\WikiPostSectionFiles.csv"
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Data Source=.;Initial Catalog=YourDataBaseName;Integrated Security=true;TrustServerCertificate=True"
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = "SELECT P.PostID, P.ParentID,P.UserID, U.UserName,P.ThreadID, T.Subject AS ThreadSubject, F.Name AS ForumNAME, S.[SectionID] ,S.[GroupID] , P.Subject, CAST(P.Body as Varchar(8000)) AS Body, P.UserTime,
G.[Name] AS GroupName, G.[ParentGroupID], S.[Name] AS SectionName ,S.[Description] ,S.[DateCreated] ,S.[TotalPosts] ,S.[TotalThreads] ,S.[ApplicationKey]
FROM [YourDatabaseName].[dbo].[cs_Posts] P
INNER Join [YourDatabaseName].[dbo].[cs_Sections] S ON S.SectionID = P.SectionID
INNER JOIN YourDatabaseName.dbo.cs_Groups G On G.GroupID = S.GroupId
LEFT Outer JOIN YourDatabaseName.dbo.cs_Users U ON U.UserID = P.UserID
LEFT OUTER JOIN [YourDatabaseName].[dbo].[te_Forum_Threads] T ON t.ThreadId = P.ThreadID
LEFT OUTER JOIN [YourDatabaseName].[dbo].[te_Forum_Threads] FT ON FT.ThreadId = T. ThreadId
LEFT OUTER JOIN [YourDatabaseName].[dbo].[te_Forum_Forums] F ON F.ForumId = Ft.ForumId"
$SqlCmd.Connection = $SqlConnection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$SqlAdapter.Fill($DataSet)
$dataTable = new-object System.Data.DataTable "PostInfo"
$dataTable = $dataSet.Tables[0]
$dataTable.Columns.Add("FileLink","string")
$dataTable.Columns.Add("BreadCrumb","string")
$fullPathName = ""
$fullFileName = ""
$fileId1 = ""
$fileId2 = ""
foreach ($Row in $dataTable.Rows)
{
if($Row.PostID.ToString().Length -lt 4)
{
$fileId1 = "0"+ $Row.PostID.ToString().Substring(0, 1)
$fileId2 = $Row.PostID.ToString().Substring(1, 2)
}
else
{
$fileId1 = $Row.PostID.ToString().Substring(0, 2)
$fileId2 = $Row.PostID.ToString().Substring(2, 2)
}
$fullPathName = "D:\Wiki\Web\filestorage\CommunityServer.Components.PostAttachments\00\00\00\"+ $fileId1 +"\"+$fileId2
$fullFileName = Get-ChildItem -Path $fullPathName -Recurse | where { ! $_.PSIsContainer } | Select-Object FullName | Out-String
$fullFileName = $fullFileName.Replace('}','')
$fullFileName = $fullFileName.Replace('-','')
$fullFileName = $fullFileName.Replace('FullName','').Trim()
$Row.FileLink = "=HYPERLINK("""+ $fullFileName + ""","""+$fullFileName+""")"
}
$dataTable | export-csv $ClientCSVPath -NoTypeInformation
write "wiki Post with Section files successfully exported in to " $ClientCSVPath
There are two file storage folders where you can find all files which is posted in Forums, Posts or in Replies of any discussion.
Root of Web Site --> Web\filestorage\telligent.evolution.components.attachments
Root of Web Site --> Web\filestorage\CommunityServer.Components.PostAttachments
You can find any upload in
Root of Web Site --> Web\filestorage\CommunityServer.Components.MultipleUploadFileManager
You can find Bread Crumb from below formula
Home >> Group Name >> Forum Name >> Thread Name
or
Home >> Group Name >> Parent Group Name >> Section Name >> Post Name
You can find below script to export CSV with all posts and links to file storage
clear
$ClientCSVPath = "C:\Users\$env:UserName\Documents\WikiPostSectionFiles.csv"
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Data Source=.;Initial Catalog=YourDataBaseName;Integrated Security=true;TrustServerCertificate=True"
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = "SELECT P.PostID, P.ParentID,P.UserID, U.UserName,P.ThreadID, T.Subject AS ThreadSubject, F.Name AS ForumNAME, S.[SectionID] ,S.[GroupID] , P.Subject, CAST(P.Body as Varchar(8000)) AS Body, P.UserTime,
G.[Name] AS GroupName, G.[ParentGroupID], S.[Name] AS SectionName ,S.[Description] ,S.[DateCreated] ,S.[TotalPosts] ,S.[TotalThreads] ,S.[ApplicationKey]
FROM [YourDatabaseName].[dbo].[cs_Posts] P
INNER Join [YourDatabaseName].[dbo].[cs_Sections] S ON S.SectionID = P.SectionID
INNER JOIN YourDatabaseName.dbo.cs_Groups G On G.GroupID = S.GroupId
LEFT Outer JOIN YourDatabaseName.dbo.cs_Users U ON U.UserID = P.UserID
LEFT OUTER JOIN [YourDatabaseName].[dbo].[te_Forum_Threads] T ON t.ThreadId = P.ThreadID
LEFT OUTER JOIN [YourDatabaseName].[dbo].[te_Forum_Threads] FT ON FT.ThreadId = T. ThreadId
LEFT OUTER JOIN [YourDatabaseName].[dbo].[te_Forum_Forums] F ON F.ForumId = Ft.ForumId"
$SqlCmd.Connection = $SqlConnection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$SqlAdapter.Fill($DataSet)
$dataTable = new-object System.Data.DataTable "PostInfo"
$dataTable = $dataSet.Tables[0]
$dataTable.Columns.Add("FileLink","string")
$dataTable.Columns.Add("BreadCrumb","string")
$fullPathName = ""
$fullFileName = ""
$fileId1 = ""
$fileId2 = ""
foreach ($Row in $dataTable.Rows)
{
if($Row.PostID.ToString().Length -lt 4)
{
$fileId1 = "0"+ $Row.PostID.ToString().Substring(0, 1)
$fileId2 = $Row.PostID.ToString().Substring(1, 2)
}
else
{
$fileId1 = $Row.PostID.ToString().Substring(0, 2)
$fileId2 = $Row.PostID.ToString().Substring(2, 2)
}
$fullPathName = "D:\Wiki\Web\filestorage\CommunityServer.Components.PostAttachments\00\00\00\"+ $fileId1 +"\"+$fileId2
$fullFileName = Get-ChildItem -Path $fullPathName -Recurse | where { ! $_.PSIsContainer } | Select-Object FullName | Out-String
$fullFileName = $fullFileName.Replace('}','')
$fullFileName = $fullFileName.Replace('-','')
$fullFileName = $fullFileName.Replace('FullName','').Trim()
$Row.FileLink = "=HYPERLINK("""+ $fullFileName + ""","""+$fullFileName+""")"
}
$dataTable | export-csv $ClientCSVPath -NoTypeInformation
write "wiki Post with Section files successfully exported in to " $ClientCSVPath
Comments
Post a Comment