How to work with ApexSQL Source Control in offline mode

Applies to
ApexSQL Source Control

Summary
This article explains how to use ApexSQL Source Control when the source control server is not accessible for some reason

Description

A Centralized Version Control System (CVCS) such as Subversion, Team Foundation Server, and Perforce utilize a single central repository, usually hosted on a server. Developers check out files from a central server, make changes, and commit them back to a server. Working copy of the scripts is kept in the local system, while the revision history is stored only in the central repository.

The most obvious downside of this system is the single point of failure that the centralized source control repository represents. If the central repository is not accessible (server is down or network issues), developers that are in the midst of work will be prevented to collaborate or to commit versioned changes they are working on.

As opposed to the previously mentioned source control systems, Distributed Version Control Systems (DVCS) such as Git and Mercurial will allow ApexSQL Source Control to check out the latest changes of the scripts, as they utilizing the local repository that is fully mirrored with the central repository. Therefore, if the source control server blackout occurs, work can be continued with the local repository without any interruptions or limitations. Versioning information is preserved and available locally and the developers can continue to commit changes to their local repositories.

ApexSQL Source Control fully utilizes the advantages of the distributed source control system via the implemented Offline mode. When the Offline mode is enabled, ApexSQL Source Control allows executing every command, except the merge and conflict resolution, on the local repository: commit, browse history, undo, and get by version.

To enable the Offline mode in ApexSQL Source Control:

  1. Select the dedicated database that is linked to a source control in the Object Explorer pane
  2. Right-click the database, and from the context menu select More source control options -> Go offline:

The Action center tab opens and the Go online button appears in the upper right corner of the Action center tab:

Quick tip icon

Quick tip:

The Go online button will be displayed when working with the Centralized Version Control System to indicate that source control server or network connections are not present, but commit will not be possible

Developers can continue using ApexSQL Source Control without concern that changes will be lost.

Once the source control repository becomes available, developers can switch back to the online mode by pressing the Go online button in the Action center tab, or to choose the same option from the context menu, upon right clicking a database in the Object Explorer pane. In case there are changes that are committed while the offline mode was active, the following message appears upon switching to online mode:

ApexSQL Source Control will initiate the comparing process immediately to detect which local offline commits do not exist in the central repository. After the differences are identified, ApexSQL Source Control will start the synchronization process between the local and the central repository. If there are some changes that cannot be synchronized automatically, it will revert all locally made changes to the state prior to working offline mode, pull all changes from the central repository and then present possibility to resolve conflicts. That way developers can manually synchronize changes made while working in the offline mode with changes in the central repository by others, and commit them once they are satisfied.

FAQs

Q: What if I try to switch to online mode while the internet connection is off or the server is down?

A: The Action center tab will try to connect and reload objects. In case the connection could not be established for any reason, the Go online button will appear again.

Q: What are the advantages of working in Offline mode?

A: The Offline mode can be useful in situations when a connection to the network is time limited, with low speed or with interruptions.

Q: Can I use the Offline mode in the Shared development model?

A: Yes, the Offline mode can be used in the same way in both Shared and Dedicated development models.