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.tarcd 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 fileforeach ($file in $csvFiles) {# Get the current file name$currentFileName = $file.Name# Check if the file name starts with an underscoreif ($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 fileRename-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 fileforeach ($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 fileSet-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 directorySet-Location -Path $psqlDirectory# Get all SQL files in the directory$sqlFiles = Get-ChildItem -Path $directoryPath -Filter *.sql# Loop through each fileforeach ($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 successfulif ($LASTEXITCODE -eq 0) {# Append the file name to the result fileAdd-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.rhkb.cn/news/33951.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

大数据-spark3.5安装部署之standalone模式

真实工作中还是要将应用提交到集群中去执行,Standalone模式就是使用Spark自身节点运行的集群模式,体现了经典的master-slave模式。集群共三台机器,具体如下 u22server4spark: master worker u22server4spark2: worke…

Uniapp 开发 App 端上架用户隐私协议实现指南

文章目录 引言一、为什么需要用户隐私协议?二、Uniapp 中实现用户隐私协议的步骤2.1 编写隐私协议内容2.2 在 Uniapp 中集成隐私协议2.3 DCloud数据采集说明2.4 配置方式3.1 Apple App Store3.2 Google Play Store 四、常见问题与解决方案4.1 隐私协议内容不完整4.2…

【C++】 —— 笔试刷题day_5

刷题day_5 一、游游的you 题目链接:游游的you 题目解析 题目要求: 输入a,b,c表示y、o、u三个字母的个数; 将这些字母连成字符串,并且这里you三个字母相邻获得2分,两个o字母相邻获得1分。 让我…

78. Harmonyos NEXT 懒加载数据源实现解析:BasicDataSource与CommonLazyDataSourceModel详解

温馨提示:本篇博客的详细代码已发布到 git : https://gitcode.com/nutpi/HarmonyosNext 可以下载运行哦! Harmonyos NEXT 懒加载数据源实现解析:BasicDataSource与CommonLazyDataSourceModel详解 文章目录 Harmonyos NEXT 懒加载数据源实现解…

如何打包数据库mysql数据,并上传到虚拟机上进行部署?

1.连接数据库,使得我们能看到数据库信息,才能进行打包上传 2. 3. 导出结果如下,是xml文件 4.可以查询每个xml文件的属性,确保有大小,这样才是真实导出 5跟着黑马,新建文件夹,并且把对应的东西放…

Springboot+mabatis增删改查,设置不可重复字段

今天又学会了一个操作,我们数据库中,可能要求一个字段名字不可以重复,我们就进行这样的操作!设计表,然后点击索引,选择字段,加入索引类型和索引方法,然后ctrlS保存!即可 如果一旦还…

C# NX二次开发:矩形阵列和线性阵列等多种方法讲解

大家好,今天讲一些关于阵列相关的UFUN函数。 UF_MODL_create_linear_iset (view source):这个函数为创建矩形阵列。 intmethodInputMethod: 0 General 1 Simple 2 Identicalchar *number_in_xInputNumber in XC direction.char *distance_xInputSpac…

嵌入式硬件: GPIO与二极管基础知识详解

1. 前言 在嵌入式系统和硬件开发中,GPIO(通用输入输出)是至关重要的控制方式,而二极管作为基础电子元件,广泛应用于信号整流、保护电路等。本文将从基础原理出发,深入解析GPIO的输入输出模式,包…

CTF--Web安全--SQL注入之报错注入

CTF–Web安全–SQL注入之报错注入 一、报错注入的概念 用户使用数据库查询语句,向数据库发送错误指令,数据库返回报错信息,报错信息中参杂着我们想要获取的隐私数据。通常在我们在页面显示中找不到回显位的时候,使用报错注入。 二…

matlab 模糊pid实现温度控制

1、内容简介 matlab162-模糊pid实现温度控制 可以交流、咨询、答疑 2、内容说明 略基于PID电加热炉温度控制系统设计 摘要 电加热炉随着科学技术的发展和工业生产水平的提高,已经在冶金、化工、 机械等各类工业控制中得到了广泛应用,并且在国民经济中占…

RabbitMq C++客户端的使用

1.RabbitMq介绍 RabbitMQ 是一款开源的消息队列中间件,基于 AMQP(高级消息队列协议)实现,支持多种编程语言和平台。以下是其核心特点和介绍: 核心特点 多语言支持 提供 Java、Python、C#、Go、JavaScript 等语言的客…

星越L_备胎更换/千斤顶使用讲解

目录 1.车辆停靠在坚实平坦的路面上。 2.打开危险警示灯、 3.设立三角指示牌 4.取出备胎及随车工具 5.使用螺栓扳手对每个螺母进行松动 6使用千斤顶抬升 7、其他 轮胎漏气或爆胎的情况,需要使用千斤顶更换备胎 1.车辆停靠在坚实平坦的路面上。 2.打开危险警示灯、

【Python 数据结构 15.哈希表】

目录 一、哈希表的基本概念 1.哈希表的概念 2.键值对的概念 3.哈希函数的概念 4.哈希冲突的概念 5.常用的哈希函数 Ⅰ、直接定址法 Ⅱ、平方取中法 Ⅲ、折叠法 Ⅳ、除留余数法 Ⅴ、位与法 6.哈希冲突的解决方案 Ⅰ、开放定址法 Ⅱ、链地址法 7.哈希表的初始化 8.哈希表的元素插…

软件测试之测试分类

1. 为什么要对软件测试进行分类 软件测试是软件⽣命周期中的⼀个重要环节,具有较⾼的复杂性,对于软件测试,可以从不同的⻆度 加以分类,使开发者在软件开发过程中的不同层次、不同阶段对测试⼯作进⾏更好的执⾏和管理测试 的分类⽅…

Devops CI/CD

Devops CI/CD DevOps 中的 CI/CD:持续集成与持续部署的深度解析一、CI/CD 基本概念(一)持续集成(二)持续部署 二、CI/CD 实施步骤(一)版本控制(二)自动化构建&#xff08…

leetcode105为什么可以root.left可以截取到前序遍历二叉树的(0,index),而不是(1,index+1)

这里以105前序和中序遍历构造二叉树为例,106同理 原因在于preoder.shift()会改变原数组,已经把preoder的第一个队头元素已经排除出去了!!! 306题中的截取后续遍历中用pop()同理

数据结构---堆栈和列

一、堆栈 1.栈堆:具有一定操作约束的线性表;(只在一端做插入删除) 2.栈的顺序存储结构: 由一个一维数组和一个记录栈顶元素位置的变量组成。定义方式如下: 3.入栈操作: 注意:&…

golang快速上手基础语法

变量 第一种,指定变量类型,声明后若不赋值,使用默认值0 package mainimport "fmt"func main() {var a int //第一种,指定变量类型,声明后若不赋值,使用默认值0。fmt.Printf(" a %d\n"…

【idea代码ai插件】利用接入硅基流动的deepseekR1的api在idea里实现问答,辅助写代码

注册硅基流动账号 https://siliconflow.cn/zh-cn/ 然后新建api密钥,这里的api密钥可以点击复制,等会输入要用 可以看到现在新注册是有额度的,你们应该是14元 模型广场这里可以调用deepseek的v3和r1,注意因为是蹭,赠…

NO.42十六届蓝桥杯备战|数据结构|算法|时间复杂度|空间复杂度|STL(C++)

数据结构 什么是数据结构 在计算机科学中,数据结构是⼀种数据组织、管理和存储的格式。它是相互之间存在⼀种或多种特定关系的数据元素的集合。 说点通俗易懂的话,数据结构就是数据的组织形式,研究的就是把数据按照何种形式存储在计算机中 …