Forum Discussion
SQL logshipping
By default, SQL Server:
• uses the file paths embedded in the backup
• or falls back to instance default data/log paths
You can check following:
1. SELECT
SERVERPROPERTY('InstanceDefaultDataPath'),
SERVERPROPERTY('InstanceDefaultLogPath')
If both point to same drive then both files land there.
2. Missing MOVE clauses during restore
WITH MOVE 'logical_data_name' TO 'D:\Data\DBfile.mdf',
MOVE 'logical_log_name' TO 'L:\Logs\DBfile_LOG.ldf'
Without this, SQL uses original or default paths.
You can try following fix:
1. Take FULL backup on primary
2. On secondary, run:
RESTORE DATABASE YourDB
FROM DISK = backuplocation
WITH
MOVE 'YourDB_Data' TO 'D:\SQLData\YourDB.mdf',
MOVE 'YourDB_Log' TO 'L:\SQLLogs\YourDB.ldf',
NORECOVERY;
3. Then configure log shipping without initialization
Tip(Based on experience): Always initialize secondary database manually