Developer forum

Forum » Dynamicweb 10 » Using CLI for deploy - Overwrite parameter not working

Using CLI for deploy - Overwrite parameter not working

Chris Søgaard
Chris Søgaard
Reply

Hi DW

I can seem to update files on DW Cloud hosting using the CLI and maybe I'm doing something wrong, but it seems like I can't get the overwrite parameter to work. I can upload files, but I cannot overwrite existing files on the target. Any input on this will be valuable.

I try to upload the files recursively in an environmentless setup. I use this command line to do so to upload files that is already existing on target:

But when I do this nothing happens with the files, they are not overwritten and stays the same.

If I instead try to upload the same files to a new folder, that is not currently present on target the files are uploaded succesfully:

Are there any issues here or am I doing something wrong?

BR Chris


Replies

 
Lionel Huizing
Reply

Hi Chris, 

I also have the same problem. 

I made pipeline in DevOps:

On row 35 you'll see my command to export the files (custom add-in) to the destinationfolder.

Logging:

When the destinationfolder is empty it will work correctly, when the folder contains files it's a different story.

Can someone help me out?

Thanks in advance!

Kind regards,

Lionel

 

 

 
Frederik Nielsen Dynamicweb Employee
Frederik Nielsen
Reply

Hi!

It turns out the CLI had an issue uploading files to a folder that already had files, as you've experienced. The way it was using the upload endpoint in DynamicWeb was outdated, and it has now been updated to properly respect the overwrite form parameter instead of relying on its own logic to figure out which files to upload.

It has been published with version 1.0.6 and from what I've tested, both of your cases should be covered in this fix.

 

//Frederik

 
Chris Søgaard
Chris Søgaard
Reply

Hi Frederik

I can confirm that this is working when uploading a simple folder with files.

It does not work when uploading folders recursively (folders in folders), and it seems like this does not work regardless of whether or not that folder is new. Take this example where I'm trying to upload a new folder with a new file, with the recursive parameter set:

dw files -iro C:\Users\chs\Downloads\drop\drop\files\Files\Templates Templates --host x.dw10.dynamicweb-cms.com --apiKey CLI.x

Output shows this:

But file system in DW10 does not contain this folder:

 
Frederik Nielsen Dynamicweb Employee
Frederik Nielsen
Reply
This post has been marked as an answer

Hi Chris!

You're completely right, I seem to have missed that part and published a bugfix for this, 1.0.7 should have it fixed and wokring properly now.

 

//Frederik

Votes for this answer: 1
 
Chris Søgaard
Chris Søgaard
Reply

I can confirm that this is now working as intended

 

You must be logged in to post in the forum