YAFLogo

Posted by: Bamurien - Tuesday, 13 March 2012 20:11:25
Good afternoon, I currently have 1.9.5 RC1 installed, using a SQL 2008 database. I installed using the Microsoft Web App Gallery. I am now trying to upgrade (I have tried to both 1.9.5.5 and 1.9.6). When I get to the part of the install where it tests the database connection, the test always fails with some form of the following error: "Failure to attach to database." If I create a new connection string instead of using an existing one, I can get around this error. However, then I get an error at the very end of the install saying it cannot create tables (starting with Thanks) on database 'master'. This seems strange to me - why would it be creating new tables if it is an upgrade? For that matter, why won't the old connection string work? If anyone could assist me in upgrading to 1.9.6 (or even 1.9.5.5) I would greatly appreciate it. Please let me know if any more info is needed from me, I know the error messages aren't entirely precise - I am trying to avoid breaking my forums again to duplicate the error unless I must. Thanks.

Posted by: JP - Tuesday, 13 March 2012 20:53:17
Does the yaf database user in your connection string have enough rights to create tables & stored procedures in the db that houses the yaf tables? Usually it's enough to assign "dbowner" rights for the database during install in the user mapping for the db user specified. If using a freshly installed 2008, make sure that SQL Server logins are allowed (default off using standard "next/next/next" install). After the upgrade/install - the db user needs "datawriter, datareader" boxes checked in the user mapping, as well as "grant Execute" in the specific database Permissions so the stored procedures work.

Posted by: Bamurien - Tuesday, 13 March 2012 20:57:42
To be honest - I'm not sure what rights the db user has. m6.net is my host and the user was created automatically. I guess the next step is to download a backup of the database, restore it, and check the user rights there? I don't think I can do it from the control panel. Though if it worked on the initial install of 1.9.5 wouldn't that mean the user does have the rights? Or is it different for 1.9.5? Thanks for the quick reply.

Posted by: JP - Tuesday, 13 March 2012 21:14:54
Shouldn't be any difference regarding rights between 1.9.5 and later with the same user. Since you are running your site without direct access to the SQL Server tools (ie Management Studio), maybe you should contact m6 to know if you have full control of your database(s) or not. Could be a provider restriction if they have upgraded the SQL Server lately. I am myself running with full control of the Win server & SQL Server, so I am maybe not a good reference to talk about issues in a remotely hosted environment. However, if the "Thanks" table was introduced after 1.9.5 (don't remember when...) , I think my comments in the earlier post are still valid, so you should contact m6 to resolve potential db rights issues, IMHO.

Posted by: Bamurien - Tuesday, 13 March 2012 21:21:26
There's a Thanks table in 1.9.5. I commented out the creation of the Thanks table and it just moved on and gave me an error in the next table that it's supposed to create. The fact that it's giving an error in the database "master" seems strange to me - that's not the name of my database. Is it possible that when YAF attaches its database to mine, "master" is the default one it looks for? My user definitely wouldn't have access to that, since it isn't the database I created for my forum. As for the reason why it would look for some default database to attach to - maybe because I had to change my connection string? I'm just spitting stuff out here, not really sure if any of that is possible or how to fix it if it is.

Posted by: JP - Tuesday, 13 March 2012 22:00:28
Seems strange indeed that the update script is trying to create tables in the master db... To me it indicates that you do not have rights to create tables in your database and falls back to the "default database" specified for the db user, which is the master db if you don't configure it. I'd say it is a provider problem... What does your connections string look like (leave out the pw and such if you post it here). Mine is as simple as this and has worked since 1.9.4 (generic values for the parameters): [code]data source=(local);initial catalog=database-name;user=db_user;password=db_user_password[/code] Of course the data source parameter has to point to the SQL Server machine if the db server is on a different machine than the web server.

Posted by: Bamurien - Tuesday, 13 March 2012 23:06:40
Okay - I feel a bit dumb now. New version of db.config gets uploaded when I install the new version, same with app.config. So in addition to merging the web.config files, I had to fix those files too. I have successfully upgraded to 1.9.5.5, thanks for leading me in the right direction. However, 1.9.6 still doesn't seem to work. Error message is: Could not load file or assembly 'YAF.Classes.Config' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Posted by: tha_watcha - Wednesday, 14 March 2012 01:35:29
[quote=Bamurien;53690]Okay - I feel a bit dumb now. New version of db.config gets uploaded when I install the new version, same with app.config. So in addition to merging the web.config files, I had to fix those files too. I have successfully upgraded to 1.9.5.5, thanks for leading me in the right direction. However, 1.9.6 still doesn't seem to work. Error message is: Could not load file or assembly 'YAF.Classes.Config' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.[/quote] 1.96 is [b].NET 4.0[/b] you need to change your application Pool to the Correct Pool. Of course you need to Have .NET 4 Installed on the Server to do that

Posted by: Bamurien - Wednesday, 14 March 2012 01:39:36
Thanks. Where can I change that at?

Posted by: tha_watcha - Wednesday, 14 March 2012 01:47:11
[quote=Bamurien;53696]Thanks. Where can I change that at?[/quote] If you have access to the server tools you would do that directlly in [url=http://technet.microsoft.com/en-us/library/cc731755(v=ws.10).aspx]iis manager[/url], if thats not possible i dont know if you can change that in the Admin Control Panel (or whatever this is called)of your hosting site. Or you have to ask your hosting Provider.

Posted by: Bamurien - Wednesday, 14 March 2012 01:48:28
Okay thank you.