Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
simonheap
Partner - Contributor II
Partner - Contributor II

Using Qlik cli - deleted .qvd-files or not?

Hi! 

I have used the Qlik cli with Powershell to get rid of a bunch of .qvd-files in my  Qlik Sense SaaS that I moved to a space with Qlik Data Transfer. I used the qlik item rm-command to do this.

If I now list my files using qlik item ls I no longer see my deleted files - nice, quite as expected. And if I go to my space in QS SaaS I do not see them either.

However, when I go to the Data Connection of my space to build an app, I still see the files I deleted. I can even choose data for my app from these files or get the out the xml QvdTableHeader-information from them.

What am I doing wrong - or not doing?

Thanks for sharing any experiences!

Best regards

Simon

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
simonheap
Partner - Contributor II
Partner - Contributor II
Author

Hi Damien

Well, that's not a good situation to be in. You have an API that lets you remove the reference, but not the file. The problem then is, that if you should use the qlik item rm-command, you can't see the files in QS SaaS any longer - so it's a Catch 22: the files are not deleted by the API, but since you can't see them, you can't delete them manually either.

I suggest you discontinue the rm-command asap. It seems it creates more frustration than any good. And get the qix-datafiles API running asap too 🙂

Thanks for the feed-back!

All the best

 

Simon

View solution in original post

7 Replies
han
Employee
Employee

Hi and thanks for taking the time to post the question

We will try to reproduce the issue.
What version of qlik-cli are you using?

simonheap
Partner - Contributor II
Partner - Contributor II
Author

Hi Han

It's v2.2.0. I grabbed it from https://github.com/qlik-oss/qlik-cli/releases, and I see a newer version v2.2.2 is made availble during the week.

My work around has been to delete ALL .qvd-files from my space using the Qlik cli, delete my space using QS SaaS, delete my folder connection from QDT, change the folder structure on the Win12 Qlikview-server and set the whole thing up anew: new QDT Connection, new space = new files. Now I have the .qvd-files I want.

Best,

Simon

Damien_V
Support
Support

Hi @simonheap 

It's not possible yet to fully delete those files with the Qlik Cli. 

qlik item rm would only remove some references to the files.

This needs to be performed with the qix-datafiles API, however this API is not public yet.
We are working to make it public and it should be available very soon, it will be added in the documentation on https://qlik.dev once available. Stay tuned !

If the issue is solved please mark the answer with Accept as Solution.
simonheap
Partner - Contributor II
Partner - Contributor II
Author

Hi Damien

Well, that's not a good situation to be in. You have an API that lets you remove the reference, but not the file. The problem then is, that if you should use the qlik item rm-command, you can't see the files in QS SaaS any longer - so it's a Catch 22: the files are not deleted by the API, but since you can't see them, you can't delete them manually either.

I suggest you discontinue the rm-command asap. It seems it creates more frustration than any good. And get the qix-datafiles API running asap too 🙂

Thanks for the feed-back!

All the best

 

Simon

nachelly
Contributor II
Contributor II

Do you have any idea how can i move some qvds from one space to another?

AlexOmetis
Partner Ambassador
Partner Ambassador

Noticed that Tenant Admin cannot delete datasets for unknown / ... - Qlik Community - 1906888 now recommends using qlik-cli for bulk deleting QVDs. @Damien_V - has the bug been resolved or should that KB be removed/updated? 

Qlik Partner Ambassador 2024
Levi_Turner
Employee
Employee

I was chatting with @AlexOmetis  earlier today and wanted to update this thread. On or about May 13th 2022 (beginning with qlik-cli v 2.11.1 / https://github.com/qlik-oss/qlik-cli/releases/tag/v2.11.1 ), the SaaS platform (and qlik-cli) added support for interacting with files on the platform.

Examples of usage:

Removing all data files in a specified space

$space_id = '63594739252c1b8cf49ca5fc' # Define my space id
$connections = qlik raw get v1/data-connections --query spaceId=$space_id,limit=100 | ConvertFrom-Json # Get all data connections for the specified space
foreach($connection in $connections) {
    if($connection.qName -eq 'DataFiles') {
        # If the data connection name in the specified space = "DataFiles" then store this data connection id
        $space_data_file_connection_id = $connection.id
        }
}
# Get all files stored in DataFiles for the specified space
$space_files = qlik data-file ls --connectionId $space_data_file_connection_id | ConvertFrom-Json
$space_data_files = @()
foreach($space_file in $space_files) {
    $space_data_files += $space_file.id
}
foreach($space_data_file in $space_data_files) {
    qlik data-file rm $space_data_file
}

 Uploading a file (which does not already exist):

$myFilePath = 'C:\etc\Data\CSV.csv' # Where is the file
$myFile = $myFilePath -replace '.*\\' # Store just the file name (e.g. CSV.csv)
$spaceId = '5e42f2cc0ea40d0001214b3a' # Define my space id
$dataFiles = @()
$connections = qlik raw get v1/data-connections --query spaceId=$spaceId,limit=100 | ConvertFrom-Json # Get all data connections for the specified space
foreach($connection in $connections) {
    if($connection.qName -eq 'DataFiles') {
        # If the data connection name in the specified space = "DataFiles" then store this data connection id
        $spaceDataFileConnectionId = $connection.id
        }
}
# Upload a specified file to the DataFiles connection in the specified space
qlik data-file create --name $myFile --file $myFilePath --connectionId $spaceDataFileConnectionId

Updating a file:

$myFilePath = 'C:\etc\Data\CSV.csv' # Where is the file
$myFile = $myFilePath -replace '.*\\' # Store just the file name (e.g. CSV.csv)
$spaceId = '5e42f2cc0ea40d0001214b3a' # Define my space id
$dataFiles = @()
$connections = qlik raw get v1/data-connections --query spaceId=$spaceId,limit=100 | ConvertFrom-Json # Get all data connections for the specified space
foreach($connection in $connections) {
    if($connection.qName -eq 'DataFiles') {
        # If the data connection name in the specified space = "DataFiles" then store this data connection id
        $spaceDataFileConnectionId = $connection.id
        }
}
# Get all files stored in DataFiles for the specified space
$spaceFiles = qlik data-file ls --connectionId $spaceDataFileConnectionId | ConvertFrom-Json
foreach($spaceFile in $spaceFiles) {
    IF($spaceFile.name -eq $myFile) {
        # Store the id of the file
        $dataFileId = $spaceFile.id
    }
}
# Replace the existing file with a file from disk
qlik data-file update $dataFileId --file $myFilePath --connectionId $spaceDataFileConnectionId