SQL Server Error 1490: Fix the Remote Copy Issue
In this article
SQL Server error 1490 ("The remote copy of database has not been rolled forward to a point in time that is encompassed in the current log backup chain") means the mirror or secondary copy of a database is behind the log chain your principal server is trying to apply. In plain terms, the two sides of a database mirroring or log shipping setup have drifted apart, and SQL Server refuses to continue until you bring them back in sync. The fix is almost always one of three things: restore the correct log backups on the secondary, re-establish the mirror with a fresh full backup, or remove and reconfigure the partner. This guide walks through the diagnosis and each repair path in order of least disruption.
What You'll Need
- SQL Server Management Studio (SSMS) or sqlcmd access to both the principal and the mirror/secondary instance.
- An account with sysadmin or at least ALTER DATABASE and backup/restore rights on both servers.
- A recent full backup and the complete chain of transaction log backups from the principal, stored somewhere both instances can read.
- Network connectivity and matching endpoints between the two instances (for mirroring).
- A maintenance window if you plan to reinitialize the mirror, because the database will be unavailable on the mirror while it restores.
Step-by-Step
- Confirm the error and identify the role of each server. Run
SELECT DB_NAME(database_id), mirroring_role_desc, mirroring_state_desc FROM sys.database_mirroring WHERE mirroring_guid IS NOT NULL;on both instances. The principal will show PRINCIPAL and the other side will show MIRROR, SUSPENDED, or DISCONNECTED. If mirroring_state_desc is SUSPENDED, note that and continue; if it is DISCONNECTED, check connectivity before anything else. - Check the last log applied on the mirror. On the mirror instance, run
SELECT DB_NAME(database_id), last_log_backup_lsn FROM sys.database_mirroring;and compare it withSELECT MAX(last_log_backup_lsn) FROM sys.database_mirroring;on the principal. A large gap confirms the mirror has not received or applied the logs the principal is now sending. - Look at the SQL Server error log on both sides. Open SSMS, connect to each instance, and expand Management > SQL Server Logs. Look for messages around the time the mirroring session stopped. Typical causes are a failed log backup, a restore that was interrupted, a disk that filled up, or a manual failover that left the old principal out of date.
- Decide whether the mirror can be caught up. If you still have every transaction log backup taken since the mirror was last synchronized, you can restore them in order on the mirror and resume. If any log backup in the chain is missing or was deleted, you cannot catch up and must reinitialize instead.
- To catch up: restore the missing log backups on the mirror. Put the mirror database into restoring state if it is not already:
RESTORE DATABASE YourDb WITH NORECOVERY;Then restore each log backup in sequence, always with NORECOVERY, for exampleRESTORE LOG YourDb FROM DISK = 'D:\Backups\YourDb_Log1.trn' WITH NORECOVERY;Repeat for every log up to the most recent one the principal has taken. - Resume the mirroring session. On the principal, run
ALTER DATABASE YourDb SET PARTNER RESUME;Then checksys.database_mirroringagain; mirroring_state_desc should move to SYNCHRONIZED or SYNCHRONIZING. - If the chain is broken, reinitialize the mirror. On the mirror, drop the existing mirror database with
DROP DATABASE YourDb;(this deletes the mirror copy only; confirm you are on the mirror instance before running it). Take a fresh full backup on the principal withBACKUP DATABASE YourDb TO DISK = 'D:\Backups\YourDb_Full.bak' WITH INIT;then a log backup withBACKUP LOG YourDb TO DISK = 'D:\Backups\YourDb_Log.trn' WITH INIT; - Restore the fresh backups on the mirror. Run
RESTORE DATABASE YourDb FROM DISK = 'D:\Backups\YourDb_Full.bak' WITH NORECOVERY;followed byRESTORE LOG YourDb FROM DISK = 'D:\Backups\YourDb_Log.trn' WITH NORECOVERY;The database must stay in RESTORING state; do not use WITH RECOVERY. - Re-establish the partner. On the mirror, run
ALTER DATABASE YourDb SET PARTNER = 'TCP://PrincipalServer:5022';using your actual principal address and port. On the principal, runALTER DATABASE YourDb SET PARTNER = 'TCP://MirrorServer:5022';Wait for the state to reach SYNCHRONIZED. - If mirroring will not resume at all, remove and rebuild it. On the principal, run
ALTER DATABASE YourDb SET PARTNER OFF;thenALTER DATABASE YourDb SET SAFETY FULL;andALTER DATABASE YourDb SET PARTNER = 'TCP://MirrorServer:5022';Rebuild the endpoint on both sides if the error log shows endpoint problems:CREATE ENDPOINT Mirroring STATE = STARTED AS TCP (LISTENER_PORT = 5022) FOR DATABASE_MIRRORING (ROLE = ALL); - Verify. Run a small insert on the principal and confirm it appears on the mirror after a few seconds, and check that the error log no longer shows 1490.
Common Mistakes
The most frequent mistake is restoring a log backup with WITH RECOVERY on the mirror, which takes the database out of RESTORING state and makes it impossible to apply further logs. Always use WITH NORECOVERY on the mirror. Another common error is restoring logs out of order or skipping one; SQL Server will reject the restore with a message about the log chain being broken. People also run the DROP DATABASE step on the principal by mistake, which destroys the live database rather than the mirror copy, so double-check the instance name in the SSMS connection bar before running it. Finally, restoring a full backup taken after the mirror fell behind but forgetting the matching log backup leaves the mirror at a different point in time and the error returns immediately.
Tips
Keep every transaction log backup until you are certain the mirror is synchronized; deleting them early is what turns a catch-up into a full reinitialize. Use a consistent naming scheme with timestamps so you can restore logs in the right order without guessing. Test the mirroring endpoint with SELECT * FROM sys.database_mirroring_endpoints; before rebuilding, and confirm the service account has CONNECT permission on the endpoint. If you use log shipping rather than mirroring, the equivalent check is the restore job history on the secondary, and the fix is to re-run the copy and restore jobs or reinitialize the secondary from a fresh backup. Schedule log backups frequently enough that a failure leaves a small gap to close.
Troubleshooting
If RESUME returns an error about the partner not being in the right state, check that the mirror database is still in RESTORING state with SELECT name, state_desc FROM sys.databases; If it shows ONLINE, you restored with RECOVERY and must start over from the full backup. If the error log reports endpoint or login failures, verify the port is open between the servers and that the service accounts can authenticate. If the mirror connects but stays in SYNCHRONIZING for a long time, check disk space and log growth on the mirror. If the principal itself is the server that failed, you may need to force service on the mirror with ALTER DATABASE YourDb SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS; — this can lose recent transactions, so use it only when the principal is unrecoverable and you accept that risk. After forcing service, the old principal must be rebuilt from a fresh backup before it can rejoin.
Frequently Asked Questions
Does error 1490 mean I have lost data?
Not necessarily. It means the mirror cannot apply the current log chain. If you still have the missing log backups, you can catch up without data loss. If the logs are gone, you must reinitialize from a fresh full backup.
Can I fix 1490 without taking the database offline?
Yes, if you can restore the missing logs on the mirror while it remains in RESTORING state. The principal stays online throughout. Reinitializing the mirror does require dropping and restoring the mirror copy, but the principal database remains available.
What is the difference between error 1490 and 1418?
Error 1418 is a connectivity or endpoint problem between the partners. Error 1490 is specifically about the log chain being out of sync. Fix connectivity first, because 1490 cannot be resolved while the partners cannot talk to each other.
Do I need to stop mirroring before restoring logs on the mirror?
If the session is suspended, restore the logs first and then resume. If it is still running, suspend it with ALTER DATABASE YourDb SET PARTNER SUSPEND; before restoring, then resume afterward.
Will reinitializing the mirror affect the principal database?
No. Reinitializing only drops and restores the mirror copy. The principal keeps running and serving queries, though mirroring protection is absent until the restore completes and the partner is re-established.
How do I prevent 1490 from happening again?
Keep log backups on a schedule, retain them until the mirror is confirmed synchronized, monitor mirroring state with a SQL Agent alert, and make sure the mirror has enough disk space for log growth.