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
Microsoft SQL Server 2008Microsoft SQL Server 2005Microsoft SQL ServerDatabases

Avatar of undefined
Last Comment
jogos

8/22/2022 - Mon
jogos

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.
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
Jim P.

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.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
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
jogos

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question