Link to home
Start Free TrialLog in
Avatar of apitech
apitech

asked on

"New" SQL Files After Restore

Hello:

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.

Thanks!

Apitech
Avatar of jogos
jogos
Flag of Belgium image

How did you restore your databases?
If you had the move-statement in it to relocate your db-files to new directory you renamed it yourself.
Avatar of apitech
apitech

ASKER

Hello:

No, I used the graphical user interface of the SQL Management Studio.

In any case, is there anything wrong with not changing the file names to match what was already on the server (using the second tab of the restore window), even though I did not need those "old" files?

Apitech
I almost never use the SQL GUI -- or if I do --I use it to script my actions that I modify as needed.


I would say if you have a test/dev environment that you can try a similar restore, do it. But instead of hitting the OK, hit the scipt button and see what you get.
Avatar of apitech

ASKER

Thanks, for the responses!

In keeping that I do use the GUI and that I don't have a test environment to re-try, is there anything wrong with not changing the file names to match what was already on the server (using the second tab of the restore window), even though I did not need those "old" files?

Also, why did the file names change the second time around?

Apitech
ASKER CERTIFIED SOLUTION
Avatar of jogos
jogos
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial