Skip to main content
Announcements
UPGRADE ADVISORY for Qlik Replicate 2024.5: Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
selvakumars
Contributor II
Contributor II

What is the syntax on repctl command line to exportrepository task=<tsk_name> without endpoints

hello Support,
What is the syntax on repctl command line to exportrepository task=<tsk_name> without endpoints?
I know there is an easy option for exporting with or without endpoints in QEM (Enterprise manager), but I need command line command, because I need to set this up in .bat script. 
Kindly assist

Labels (2)
1 Reply
Heinvandenheuvel
Specialist III
Specialist III

>> What is the syntax on repctl command line to exportrepository task=<tsk_name> without endpoints?

I don't think that exists for REPCTL. See full HELP output for exportrepository below.

it is a simple matter of programming though if you are scripting anyway.  Years ago I made 'superscripts' for JSON manipulation in PERL and Powershell. They can delete 'sections' from the json file on request.

Here is a PERL variant, just to delete the 'databases' section from a JSON exports. Note: the textual formatting will be too different to be able to readily compare old and new, but it imports fine and you could re-export to get the Replicate formatting style to check against old. I just made this, and only tested against 1 task. Your mileage may vary.

Good luck,

Hein.

my $usage = qq(Usage:\n\tperl < old.json > new.json\n);
use strict;
use warnings;
use JSON qw( to_json from_json );
                                  
my ($verbose, $json_text, $decoded_json) = (1, '');
for (<STDIN>) {
	next if /^\s*\/\//; # Ignore comment line(s) - typically just the first line.
	$json_text .= $_;
} 
print STDERR "$. input lines, ",length($json_text)," bytes in input file\n"  if $verbose;
die "input file does not look reasonable. Only $. input lines" if $. < 10;

$decoded_json = from_json( $json_text );

if (defined($decoded_json->{'cmd.replication_definition'}->{databases})) {
	delete($decoded_json->{'cmd.replication_definition'}->{databases});
} else {
	printf "Section <databases> does not exist in this input json\n";
}

$json_text = to_json ( $decoded_json, { pretty => 1 } );
print STDOUT $json_text;

 

command exportrepository:
    request arguments:

    task:optional string
    include_server_settings:optional BOOL
    only_external_table_defs:optional BOOL
    folder_name:optional string
    unique_name:optional BOOL
    endpoint:optional string
    calculate_db_qri:optional BOOL

    response arguments:
    message:optional string
    file_path:optional string
[exportrepository command] Succeeded