Use sp_config_rep_agent to disable RepAgent.
Before disabling RepAgent using sp_config_rep_agent, you must first shut it down using sp_stop_rep_agent.
sp_config_rep_agent pubs2, 'disable'
Once the secondary truncation point is disabled, the log can get truncated past the secondary truncation point.
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.
alter connection to TOKYO_DS.pubs2 set log transfer off