Error Deploying 4.1 Site - Database '----' already exists
Within my development environment I successfully upgraded a Sitefinity 4.0 SP1 site to version 4.1 (4.1.1339.0) by following the installation guide. After a few changes to my custom controls to make them compatible with the new version everything looked good and I proceeded to deploy to a new server by backing-up/restoring the database to the target database instance, publishing the site from Visual Studio and copying the file structure to the destination server, and then setting up the website on the server through IIS6 (ensuring to perform the nit-picky adjustments so the site will work in IIS6). However, when I hit the site through a browser I'm greeted with the error Database '---' already exists. Choose a different database name. (where --- is the name of the database defined in the DataConfig file). I can't seem to figure out why the bootstrapper is attempting to create the database when it already exists (and is a completely valid 4.1 site database)? Furthermore, if I change the DataConfig to point to the database within my development environment the site works! Unfortunately for a site moving to production is not going to work for me. What exactly am I doing wrong?
Hello Anthony,
Sorry about the delay regarding your service request.
Please check whether
you have a database with the same name attached to you current server instance. Can you also provide the configuration settings regarding your database which is in the data.config file and some information about your sql server setup?
Thanks for your cooperation in advance.
Best wishes,
Victor Velev
the Telerik team
Thanks Victor, I appreciate the assistance.
I returned to this problem this morning and had an ah-ha moment. In migrating my newly-upgraded 4.1 website to the destination server I copied the application files to the server and then performed a restore of the database to that server, restoring on top of the existing pre-4.0 database. What I failed to do was re-link the login, as during the restore since the SQL login already exists on that server the database's restore login becomes orphaned.
To fix this, I ran the following SQL query against my Sitefinity 4.1 database (where 'app_sitefinity4' is the login defined in my Data.config):
exec
sp_change_users_login
'Auto_Fix'
,
'app_sitefinity4'
;
The row for user 'app_sitefinity4' will be fixed by updating its login link to a login already in existence.
The number of orphaned users fixed by updating users was 1.
The number of orphaned users fixed by adding new logins and then updating users was 0.
Hi Anthony,
I am glad to hear you have managed to get your site running. Indeed this is valuable information and we will make note of that scenario and have it in our minds for future ;) I will be closing the thread for now, if you feel that you need any more assistance do not hesitate to contact me again.
Regards,
Victor Velev
the Telerik team
I am getting this error going from 4.4 to 5.
I removed the previous version 4.4 of SF database. Created new database and restored version 5 into it.
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
|
Sebastian: Did you try Anthony's solution? I am asking because I am trying to determine if you have a different issue or problems with implementing his solution.
Thanks for checking in Dan. That was exactly it. User did not have enough permissions while accessing the website.
It is fixed now.
Hi,
I had similar problem with message "Database 'xxx' already exists. Choose a different database name." and want to share it with the community . Running Sitefinity 8.1.5800.0. The solution was very simple. The user in the DataConfig.config file should have User Mappings for the database ('db_owner' and 'public'). This fix my problem.
Open SQL Management studio, Connect > Security > Logins > find the user > Right click > Properties > User mappings > check the database and below check the roles. > OK.