[RESOLVED]How to change DB name, Solution Name, Project Name, .edmx name in VS2012?

Hi,

We are working on a web application, which the overall solution has 11 projects underneath it; we are now required to change the DB name, solution name and everywhere throughout the code that has a certain word; e.g. say it’s "ABC".

So, what we need to change are as follows:

1) the DB name: now it is "ABC" – we need to change it to "XYZ";

2) The Overall solution name: now it is "ABC" – need to change it to "XYZ";

3) Several project names has "ABC", need to change;

4) the entity model .edmx file is ow named as "ABCEntityModel.edmx" – need to to change it to "XYZEntityModel.edmx";

5) anywhere in the code, and in the tables of the database – I know how to do this; but welcome suggestions.

If anyone can provide suggestions on how to do each of the above (especial 4) – for which I have no idea) I’d appreciate it very much!

Thanks,

Claudia

Can’t you just rename in Visual Studio?  Maybe use find and replace where you have to?  Remember you can open all files, even edmx etc, in notepad or any text editor and do find and replace.  Are you just renaming the projects etc or are you also renaming
the namespaces?  There is a tool called ReSharper that costs money to buy, but I’m sure there is a trial version that lasts a month or something, it has a lot of refactoring tools that will help you rename things.  Visual Studio also has some refactoring tools
built in but nowhere near as many.

Thanks AidyF.

I will need to rename the namespace as well, besides the project name and solution name.

I think I can just rename them, do "search and replace" – but since I have never done this, not sure if it will mess anything up; or someone knows a better, cleaner way.

I will check out Resharper.

Thanks,

Claudia

Please make backups for all prior to this

claudia888

the DB name: now it is "ABC" – we need to change it to "XYZ";

Change it in database management (SSMS for sql server ) and in prtoject( check connection string – ususally in web.config)

claudia888

The Overall solution name: now it is "ABC" – need to change it to "XYZ";

open the .sln with notepad, change project name

change the .csproj name

open the .csprj with notepad, change 


claudia888

Several project names has "ABC", need to change;

same with previous

Also , after that, change the namespaces


claudia888

the entity model .edmx file is ow named as "ABCEntityModel.edmx" – need to to change it to "XYZEntityModel.edmx";

change in the .csproj and in  file name

1 more question on this: what is the best way to change the actual Db file name?

I meant the 2 DB files under : C:Program FilesMicrosoft SQL ServerMSSQL10_50.SQLEXPRESSMSSQLDATA

Say the old files are: MyDB.mdf and MyDB_Log.ldf.

I did everything that were suggested; but how do I changed these 2 file names to: MyNewDB.mdf and MyNewDB_Log.ldf ?

If I just right-click them and rename them – is there anything else I need to do?

Thanks,

Claudia

Update – I found this link:

http://www.codeproject.com/Tips/345942/Rename-a-Database-and-its-MDF-and-LDF-files-in-SQL

Is this the right steps to follow?

claudia888

I found this link:

http://www.codeproject.com/Tips/345942/Rename-a-Database-and-its-MDF-and-LDF-files-in-SQL

Is this the right steps to follow?

yes

Leave a Reply