I'm in the process of moving several databases to a new server. All the databases have SIMPLE recovery mode, as they are backed up once/day.
It seems that the easiest way to move the databases is to just restore from the .bak files on the new server. I've tested that this works, aside from the fact the logs of the restored databases are locked waiting for a replication that no longer exists.
This query:
USE master;
GO
SELECT
DB.name [DATABASE],
DB.recovery_model_desc [RECOVERY MODE],
DB.log_reuse_wait_desc [LOG WAITING ON],
CAST(CAST(MF.size AS decimal) * 8 / 1024 / 1024 AS DECIMAL(10,2)) [FILE SIZE GB],
CASE UPPER(REVERSE(SUBSTRING(REVERSE(MF.physical_name), 0, 4))) WHEN 'MDF' THEN 'DATA' WHEN 'LDF' THEN 'LOG' ELSE NULL END [FILE TYPE],
UPPER(REVERSE(SUBSTRING(REVERSE(MF.physical_name), 0, 4))) [FILE EXTENSION]
FROM sys.databases DB
INNER JOIN sys.master_files MF ON MF.database_id = DB.database_id
ORDER BY
[FILE TYPE] DESC,
[FILE SIZE GB] DESC
produces LOG WAITING ON = REPLICATION for the restored databases.
Since the replication no longer exists, I can't just delete the publications on the new server.
Question. Do I need to delete the snapshot replication on the databases before moving them across? Or can I change this log_reuse_wait status to NOTHING manually?
Some more detail:
Server A has replication enabled. DB A.a is marked for snapshot replication. This rep is run occasionally. Database A.a is in SIMPLE recovery mode, with a full backup taken nightly.
Server B is new and doesn't have replication enabled yet. I have found when I restore A.a to B.a, the restoration works. But the log file is still being held for replication.
I would like the log file on B.a to NOT be marked for replication...