Earlier this evening, I moved SQL databases from one server to a separate and new server (a SQL 2005 server to a new SQL 2008R2 server). I had already "practiced" this, a few weeks ago. When I say "practiced", I created the live environment (this new server) and restored databases onto it a few weeks ago.
I have been doing this sort of thing for years, but here's one thing that I had never noticed, before. Again, I had restored from the old environment to the new environment a few weeks ago.
When I restored a new set of databases into this environment, tonight, it all worked. But, the file names were different. For instance, the log file for “DATABASE” was "Database_1.ldf". When I did my new restoration, it was simply "Database.ldf".
And, in fact, when I look at the SQL log folder after the restoration this evening, "Database_1.ldf", is no longer there.
I mean, I don't need such “previous” files. Tonight represents the final and live restore of the data. And, it's there and it's working.
But, is there an explanation as to why the second restore did not contain the same file names and why the "old" files are no longer there?
Now, I did not change the file names of the files being restored to the ones that already existed. (I did check the "Overwrite the existing database" box.)
Is it "bad" that I did not change the file names? Like I said, I did not need the other files that were already there on the server since that was--for the most part--a test environment. I restored data from new backup files, into this environment, to make it a live environment.
Whatever data that was there previously and is now gone is of no concern to the client or to me, for that reason. As long as the data from the new backup files were successfully restored into the new file names, that is all we care about.
I do make it a point to change file names, when I am restoring a live database into a test database in the same instance. But, I guess I'm not clear on the good or bad of changing restored filenames. Truthfully, I don't typically change file names unless I am doing a restore into a test company in the same instance as a live company.
I'm just curious, really, more than anything else.