Disable RepAgent

Use sp_config_rep_agent to disable RepAgent.

Note: You should disable RepAgent only when you change the replicate database to a primary database, or downgrade Replication Server to an earlier version.

Before disabling RepAgent using sp_config_rep_agent, you must first shut it down using sp_stop_rep_agent.

Normally, when you disable RepAgent, the process also disables the secondary truncation point. For example:
sp_config_rep_agent pubs2, 'disable' 

Once the secondary truncation point is disabled, the log can get truncated past the secondary truncation point.

To disable RepAgent but keep the secondary truncation point, use the preserve secondary truncpt option.
sp_config_rep_agent pubs2, 'disable', 'preserve
        secondary truncpt' 

Disable RepAgent in this way to disable RepAgent momentarily.

If you are changing the primary to a replicate database, you must also turn log transfer off. After disabling RepAgent, turn log transfer off using alter connection.

For example, log in to Replication Server and enter:
alter connection to TOKYO_DS.pubs2
	set log transfer off