当前位置: 首页 > news >正文

Qlik Sense New Install with Restore

Background

In case you meet the upgrade issue like us , you can follow the below step to recover the existing data to new installed Qlik Sense .

Powered by Moshow郑锴-CSDN博客

please follow below steps:

  1. pgsql dump backup
  2. backup table into sql by DBeaver
  3. stop all qlik sense services
  4. rename QlikShare folder to QlikShareXXX
  5. uninstall Qlik Sense (May 2023) with deleting all data
  6. restart computer
  7. pure installation for Qlik Sense (May 2024) with new database setup (please remember your database passw)
  8. ensure all Qlik Sense service are up after reinstall
  9. stop all Qlik Sense service except Qlik Sense Repository Database
  10. truncate the table with escape option in the table you want to import , in DBeaver
  11. rename all he backup SQL file with powershell #1 rename
  12. update all the backup SQL file with "SET session_replication_role = replica;" in the beginning   powershell #1 append
  13. list and execute all the SQL file you want to import by powershell #3 execute SQL
  14. restart the computer
  15. check what amazing happens
  16. reimport the license and certificate
  17. verify the app and task , also user , data connection
  18. install the patching
  19. verify again
  20. notice the stakeholders

Backup all table SQL with DBeaver

Backup And Restore Commands

here are some useful dump and restore , also execute sql file script .

cd "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\12.5\bin"

.\dropdb.exe -h localhost -p 4432 -U postgres QSR

.\createdb.exe -h localhost -p 4432 -U postgres -T template0 QSR

.\pg_restore.exe -h localhost -p 4432 -U postgres -d QSR E:\Tools\QSR_backup.tar

.\pg_restore.exe -h localhost -p 4432 -U postgres -d QSR E:\Tools\QSR_backup_148_latest.tar





cd C:\Program Files\Qlik\Sense\Repository\PostgreSQL\14\bin



#dump bakcup

.\pg_dump.exe -h localhost -p 4432 -U postgres -b -F t -f "E:\Tools\QSR_backup_v14_may2024.tar" QSR



#execute single sql

.\psql.exe -h localhost -p 4432 -U postgres -d QSR -f "E:\Tools\593_backup\sql2\AppContents_.sql"

Powershell #1 rename

下面是一个PowerShell脚本,它会遍历 E:\Tools\593_backup\csv 目录下的所有 CSV 文件,并重命名这些文件,去除文件名最前面的 _ 字符。

# Powered by Moshow@zhengkai.blog.csdn.net

# Define the directory path



$directoryPath = "E:\Tools\593_backup\csv"



# Get all CSV files in the directory



$csvFiles = Get-ChildItem -Path $directoryPath -Filter *.csv



# Loop through each file



foreach ($file in $csvFiles) {



    # Get the current file name



    $currentFileName = $file.Name



    # Check if the file name starts with an underscore



    if ($currentFileName.StartsWith("_")) {



        # Create the new file name by removing the leading underscore



        $newFileName = $currentFileName.Substring(1)



        # Define the full path for the new file name



        $newFilePath = Join-Path -Path $directoryPath -ChildPath $newFileName



        # Rename the file



        Rename-Item -Path $file.FullName -NewName $newFilePath

    }

}

Powershell#2 append

下面是一个PowerShell脚本,它会遍历 E:\Tools\593_backup\sql 目录下的所有 SQL 文件,并在每个文件的开头写入 SET session_replication_role = replica; 并换行。

# Powered by Moshow@zhengkai.blog.csdn.net
# Define the directory path

$directoryPath = "E:\Tools\593_backup\sql"



# Get all SQL files in the directory

$sqlFiles = Get-ChildItem -Path $directoryPath -Filter *.sql



# Loop through each file

foreach ($file in $sqlFiles) {

    # Read the current content of the file

    $content = Get-Content -Path $file.FullName



    # Prepend the new line to the content

    $newContent = "SET session_replication_role = replica;" + [Environment]::NewLine + $content



    # Write the new content back to the file

    Set-Content -Path $file.FullName -Value $newContent

}

Powershell#3 Execute SQL

下面是一个PowerShell脚本,它会遍历 E:\Tools\593_backup\sql2 目录下的所有 SQL 文件,并针对每个文件执行命令 .\psql.exe -h localhost -p 4432 -U postgres -d QSR -f "E:\Tools\593_backup\sql2\"+文件名,同时把已执行过的文件名输出到 E:\Tools\593_backup\sql_result.txt。

# Replace with your actual passw , once you input the credential here , it will auto put into the pgsql without any manual input .

# Powered by Moshow@zhengkai.blog.csdn.net
# Define the directory paths

$psqlDirectory = "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\14\bin"

$directoryPath = "E:\Tools\593_backup\sql2"

$resultFile = "E:\Tools\593_backup\sql_result.txt"

$pgPassword = "*********" # Replace with your actual passw



# Change to the psql directory

Set-Location -Path $psqlDirectory



# Get all SQL files in the directory

$sqlFiles = Get-ChildItem -Path $directoryPath -Filter *.sql



# Loop through each file

foreach ($file in $sqlFiles) {

    # Define the full path for the SQL file

    $filePath = Join-Path -Path $directoryPath -ChildPath $file



    # Set the PGPASSWORD environment variable

    $env:PGPASSWORD = $pgPassword



    # Execute the psql command

    & .\psql.exe -h localhost -p 4432 -U postgres -d QSR -f $filePath



    # Check if the command was successful

    if ($LASTEXITCODE -eq 0) {

        # Append the file name to the result file

        Add-Content -Path $resultFile -Value $file

License issue when enter QMC

go to DBeaver and search the "Licenses" table ,clean the record, should be only one record here .

http://www.dtcms.com/a/69726.html

相关文章:

  • 【开源代码解读】AI检索系统R1-Searcher通过强化学习RL激励大模型LLM的搜索能力
  • Word 小黑第36套
  • 探索Maas平台与阿里 QWQ 技术:AI调参的魔法世界
  • 在PowerShell脚本中编辑appsettings.json
  • 鸿蒙(OpenHarmony)开发实现 息屏/亮屏 详情
  • Vue本地开发调试使用Proxy实现接口代理配合Nginx实现瓦片png文件代理,实现本地模拟GIS开发环境
  • 《解锁Netlify:静态网站托管》:此文为AI自动生成
  • 探索 Trossen AI:从 Aloha到智能机器人平台的进化之路
  • 大数据学习(69)- OLAP和OLTP
  • list常用接口及模拟实现
  • 如何查看mysql某个表占用的空间大小
  • 用 Vue 3.5 TypeScript 重新开发3年前甘特图的核心组件
  • Linux find 命令完全指南
  • 【Unbuntu安装docker】
  • Tomcat新手登峰指南:从零到部署的原子化实践
  • 《解锁Flutter:跨平台开发的未来之光》:此文为AI自动生成
  • Linux下GCC和C++实现带多组标签的Snowflake SQL查询批量数据导出程序
  • Linux常用命令速查手册
  • 一键爬取b站视频
  • 「JavaScript深入」理解 JavaScript 中的不可变对象(Immutable Object)
  • Android 高版本 DownloadManager 封装工具类,支持 APK 断点续传与自动安装
  • 玩转python:通俗易懂掌握高级数据结构-collections模块之Counter
  • 利用委托用户控件、窗体之间传值 c#
  • 响应式编程-基于Reactor模式WebFlux框架的Spring Gateway
  • 生成省市区JSON
  • http 405 Not Allowed
  • 2018年全国职业院校技能大赛-高职组计算机网络应用竞赛竞赛样题A卷
  • 一文讲通锁标记对象std::adopt_lock盲点
  • OpenAI与谷歌DeepMind新品同日竞技,谁能引领机器人现实任务新潮流?
  • C#-委托delegate