By a customer, we faced the question: how to backup and restore a replication task in Attunity Replicate?
We don’t see any button or menu into the administration web console and in the Guide line, we haven’t really a section about Backup and Restore ???

How to back up a task?

The backup is, in reality, an export…
The first step is to start a command prompt in the menu Attunity Replicate > Utilities > Attunity Replicate Command Line.
The best is to add “run as administrator”
Attunity_Backup01

You can see that you are in the folder bin from the root path of Attunity Replicate
Attunity_Backup02

After, you need to run repctl.exe to export your task:

repctl exportrepository task=<task_name>

Attunity_Backup03

At the end of the command, you have a message with the location of your file.
Attunity_Backup04

You cannot choose your location, this is perhaps the main point to improve for the next version.

I see in this location that the file is a JSON File with the name of the Task.
Attunity_Backup05

I use Notepad++ to read the file and as you can see, you have a lot of information:

Attunity_Backup07

Let’s go to descript this file:

  • Task definition:
    "task":	{
    					"name":	"TEST",
    					"source_name":	"LIOR",
    					"target_names":	["SQL2014"]
    }
    

    Very easy, just the name, source and target name…

  • Database connection settings:
    "databases":	[{
    				"name":	"LIOR",
    				"type":	"",
    				"connection_string":	"accessTempFolderDirectly=N;server=//192.168.22.200:1521/REPLI;username=REPLICATION",
    				"authenticator":	"{ZAC347EC79E956ACFE1CEBC3A5BB61EFBE322A1D5C7A7E328B}",
    				"role":	"SOURCE",
    				"is_licensed":	true,
    				"type_id":	"ORACLE_COMPONENT_TYPE"
    			}, {
    				"name":	"SQL2014",
    				"type":	"",
    				"connection_string":	"server=WS_SQL2014\\SQL2014_REPL;useWindowsAuthentication=N;database=HumanRessource;username=replication",
    				"authenticator":	"{ZA34EE778963B8AAA97CAB7BE0F9B25077C2F4FFD6B486CBB3}",
    				"role":	"TARGET",
    				"is_licensed":	true,
    				"type_id":	"SQL_SERVER_COMPONENT_TYPE"
    			}]
    

    The important things are the role between SOURCE & TARGET and that all passwords are encrypted. 😉

  • Global ETL rules (rename the schema from HR to dbo in this case):
    "global_manipulation":	{
    					"name":	"global_manipulation",
    					"rules":	[{
    							"action":	"RENAME_SCHEMA",
    							"name":	"Rename_schema",
    							"where_owner_name":	"HR",
    							"where_table_name":	"%",
    							"expression":	"'dbo'",
    							"column":	{
    								"where_column_name":	"%"
    							},
    							"to_value":	"dbo"
    						}]

I will not describe all sections from the JSON file but you can easily find information about your task and all replicated tables.
The next step is to restore the task!

How to restore a task?

Like backup is an export, restore is an import.
I “run as administrator” the “Attunity Replicate Command Line” and execute this command:

repctl importrepository json_file=<Full path to the exported *.json file>

Attunity_Backup06

Be careful, you need to refresh your web browser with the Attunity Replicate Console to see the restored task!
Et voilà, it is easy to backup & restore a replication task with Attunity replicate! 😉

But it is a pity that there is no possibility to schedule backup from the console. 😥