Log Shipping Across FTP

I had a situation where I needed to create a replica database for reporting using log shipping with two servers that aren't on the same network.  There is an excellent article describing the process on Niall Best's blog.  The instructions got me the setup that I needed on my remote SQL server but when I went to run the restore process, nothing happened.

Running the sqllogship.exe command from a command prompt gave me a "Could not find a log backup file that could be applied to secondary database" message in the results.  After confirming that my path settings were correct in the log_shipping_secondary table, I ran the sqllogship command with Process Monitor going.  Process Monitor showed that sqllogship was looking for files named "MyDatabase_*.trn".  Because my primary and secondary database names are the same, I'm not sure if the MyDatabase value is the primary or the secondary.  I would start with the primary and if that doesn't work, try the secondary.

The other thing I realized is that if multiple files are present, they need to be named such that the oldest one is comes up first.  Otherwise you could only end up with one imported per pass.  Since my files were named based on a GUID, that wasn't happening.


Update 3/26/19:

In case you're wondering if the secondary database can have a different name than the primary, that would be a definite no.  If you do that, the restore will tell you it was successful but report no logs restored.  Only by using SQL Profiler will you discover that there is an error about the log file not being for whatever database name your secondary is.

Comments

Popular posts from this blog

Accessing Dynamics NAV OData with Postman

When you are falsely accused of not having SQL Server Report Builder installed

Error with Zetadocs on Sharepoint Online