The Sync task

Synopsis

Synchronizes a target database with the package.

Description

The Sync step involves comparing the database schema and data with the source package, identifying differences, and applying the necessary changes to bring the target database up to date.

How to create the Sync task

To create the Sync task, select dbForge DevOps Automation for SQL Server - Sync.

It should be noted that you can use the dbForge DevOps Automation for SQL Server – Sync task that you can additionally use for your more advanced process DevOps scenarios. You can select both a database and a NuGet package as a source.

Database as a source

NuGet package as a source

Customization options

  • Package

  • ID

Enter the output package file name. The format is as follows: {name}.{major}.{minor}.{build}. You can use the $(Build.BuildNumber) variable to customize it for a build pipeline or the $(Release.ReleaseId) variable to customize it for a release pipeline.

  • Package folder

Specify whether the NuGet package is situated in the root directory of the repository or within a specified subfolder path.

NuGet Feed

  • URL or packages source key

Enter URL or package source key for the target NuGet feed.

  • API key

Enter the NuGet feed API key if your deployment target is the NuGet repository.

Control Options

  • Enabled

Select to enable the task in your pipeline. If a task is disabled, it will be skipped during the pipeline execution.

  • Continue on error

Select to continue the pipeline running even if this task fails.

  • Number of retries if task failed

Specify the number of retries for this task that will happen in case of task failure.

Note

This requires agent version 2.194.0 or later. Not supported for agentless tasks.

  • Timeout

Specify the maximum time, in minutes, that a task is allowed to execute before being canceled by server. A zero value indicates an infinite timeout.

  • Run this task

Specify when this task should run. Choose Custom conditions to specify more complex conditions.

Here you can select from the following options:

  • Only when all previous tasks have succeeded
  • Even if a previous task has failed, unless the build was canceled
  • Even if a previous task has failed, even if the build was canceled
  • Only when a previous task has failed
  • Custom conditions

Output Variables

  • Reference name

Any changes to the reference name will require updates to downstream tasks that uses this reference name, a valid reference name can only contain ‘a-z’, ‘A-Z’, ‘0-9’ and ‘_’.

Note

The Sync task does not allow you to perform a comparison without automatically synchronizing the source and target databases. When executed, the Sync task by default triggers the synchronization process. To obtain a comparison report without synchronizing, you may consider using the dbForge Schema Compare Pro or dbForge Studio for SQL Server Ent or Pro command line instead, and omitting the /sync switch. For example:

"C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Schema Compare for SQL Server\schemacompare.com" /schemacompare /source connection:"Data Source=DESKTOP-9NIVJ84\SQLSERVER2022;Initial Catalog=A1;Integrated Security=True;User ID=DESKTOP-9NIVJ84\1" /target connection:"Data Source=DESKTOP-9NIVJ84\SQLSERVER2022;Initial Catalog=A2;Integrated Security=True;User ID=DESKTOP-9NIVJ84\1" /report:d:\report.xml /reportformat:xml 

If you require customized solutions in your DevOps pipeline, the dbForge tool command line offers a flexible alternative that can be tailored to your specific needs. By using this method, you can configure the command line according to your tasks, and execute the dbForge tool with the required options and parameters.

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge DevOps Automation for SQL Server.
Request a demo

Request a demo

If you consider employing the DevOps Automation for your business, request a demo to see it in action.
Ready to start using dbForge DevOps Automation for SQL Server?