Mic Bravo Alpha
13 Sep 2013
23 Jan 2014
Link to this post
We are trying to restore a Sitefinity 6.2 instance manually, Site Sync is not an option in this situation and so we are resorting to manually zipping up and copying the project source code, files and database across to the target server. Then, restoring the backed up database on the target with a new name, backing up and overwriting the contents of our IIS directory with the copied project code and files, and finally changing the connection string in ~/App_Data/Sitefinity/DataConfig.config to point to the new database instance.
Whilst cumbersome, especially in a load balanced environment (and I mean actual load balanced servers, not Sitefinity in-app "Load balancing"), this should work. The problem we have is that Sitefinity seems to somehow cache the data, meaning that even though I can see the new connection string in the config file, when I navigate through the UI to Administration > Settings > Advanced > Data > Connection strings > Sitefinity.... I still see the old data in the website. I have tried, to no avail, recycling the App Pool, and even restarting the website in IIS.
So, thinking that perhaps Telerik intended us to use the UI rather than edit the DataConfig.config file directly, I changed the values in the UI and saved them. Checking the config file I can see the new values have been applied to it, but still no effect. I then deleted the Load Balancing WebServerUrl's in case that was somehow affecting it. Still no effect. To test a theory (that our DBA had possibly restored the wrong database), I actually changed the config to point to a non existent database. Still no effect - i.e. I am still seeing old data in the website.
In desperation, I deleted the Sitefinity data setting (containing the connection string) from the UI altogether and then the actual DataConfig.config file itself from the directory. Unbelievably this still had no effect! With seemingly no data connection configured, Sitefinity is still serving up data from a database that doesn't exist.
Stumped, and with a meeting to go to, I left everything in the above state and returned an hour later. On my return, after refreshing the web page again, I was relieved to see an error saying that no connection string could be found. So I copied in the DataConfig.config which I had saved out to a temporary location, complete with new connection string pointing to the restored database.
Satisfied that everything is now setup correctly, I refreshed the web page, only to be presented with...
"CREATE DATABASE permission denied in database 'master'"!! - i.e. Sitefinity cannot find the database and is trying to create a new one...
Obviously I don't want to create a new database at this point (I guess with different permissions I would get forwarded to the /Sitefinity/Startup page, but this would be equally unhelpful) and so now I'm a bit lost on how to proceed with this....
Is Sitefinity caching the data? Or the data connection string? Is there some way to force a refresh of this?
Is there a better / easier way to move to a new database?
Any help greatly appreciated