How to restore DNN Backup - dotnetnuke

I have taken DNN 6 backup in the following ways
Copy the DNN folder from C:\inetpub\wwwroot
Take Sqlserver 2008 Enterprise edition database backup
When I try to restore it, I am getting error:
Connection Error(s): Index #: 0 Source: .Net SqlClient Data Provider
Class: 14 Number: 18456 Message: Sql login failed
I am using the following link for restoration:
.../Install/InstallWizard.aspx
Note !!! When i change the database and username, it will install the fresh installation but not restoring backup database.
How to solve this problem?

Some of the answer here will depend on where/how you are restoring the database.
If you take a database from one server to the other, the user account does NOT come with it from a server login perspective. So after restoring the database, you will need to create a new user account for managing the access to the database.

I'm not sure about needing to run the /InstallWizard.aspx to perform a restore. The first step is to get the files laid down in the Windows directory you want, and then get the IIS setup and pointed properly ensuring that you have the right security access (Depending on your version of IIS) to the files. If you get all that right you will be good to go from a file perspective.
As far as SQL Server you will need to do a manual database restore and as Mitch says create a new account that will have access to the database - You will need to change both database access statements the web.config to specify the new user. (standard and legacy if they both exist) Finally, make sure that SQL server is configured in Mixed Mode Authentication if you are specifying a SQL user.

Related

SQL Server Express unable to set login password

I've installed SQL Server Express 2019 on a Windows machine for Sitecore development. I had a hard drive crash and needed to rebuild; prior to the crash everything was working fine.
Mixed authentication is enabled, as is the SA account.
The Sitecore installer can connect to my local instance, and sets up the database structure, including a set of database logins. Everything looks OK in SSMS and initially works - I get the Welcome to Sitecore page.
However, connecting to SSMS and then trying to log in with the passwords Sitecore generated fails. When I try to set them in SQL Server, they don't take (I always get a bad password error).
I've tried as both my Windows account (which installed SQL Server) and as the sa account I configured at install. Also tried running as administrator.
The GUI and scripts seem to work fine, but the passwords never seem to get set. Prior to the crash I could connect to SSMS using the generated logins, and verify connectivity.
I'm at a loss where to go from here, other than imaging the machine and reinstalling a fresh copy of Windows.
I'm assuming that you had to reinstall SQL Server and then perform a database restore from a backup.
If this was the case, the users in the database, after the restore, were "orphaned", as they had no corresponding login in the master database. Even if Sitecore did create logins, they would have different SIDs to the users in the Sitecore database. The only way work with those users, would have been to restore a backup of the master database, in which case both server logins and database users would have had the same SIDs.
Failing that, your only option was to delete the users and re-create the logins and users correctly, which you did.
For future reference check out Microsoft's documentation on troubleshooting orphaned users in SQL Server.
So, no, this was not "a quirk with the installer and SQL Express or some kind of bug." ;-)
HTH Sean

Restore .bak on Azure SQL database through SSMS: Failed to connect to Server ***. Login Failed for user ***

I am trying to restored a .bak file on an Azure SQL server through SSMS.
The reason why I am doing this is that my company unfortunately blocked any action on the Azure portal itself and therefore I have to find another way around.
I am able to connect successfully to the DB on Azure with my admin account through SSMS.
I first successfully restored the .bak on my local database. And then I am trying:
Again, I am able to connect through the same SSMS to the SQL db.
Moreover, when starting this procedure I get asked to connect first to the DB, which works successfully! What I mean is:
It doesn't give me any error, which is weird because if I try to connect with a wrong password it tells me right away that is wrong. So it kind of accepts it. It's only after when I really start the deployment that it gives me the problem:
Just for now, Azure SQL database doesn't support restore from .bak file.
You work flow should be right, restore the .bak file(database) into a local SQL Server firstly, then deploy the restored database to Azure with "Deploy database to Microsoft Azure SQL database".
Make sure you are using the server admin account of the Azure SQL database. Per my experience, the error is usually caused by the permission limits.
If all of these(SSMS) don't work, please thy other ways. Please try Data Migration Assistant(DMA) migrate the database. If DMA still give the same error, we can ensure that it's not caused by the tools, you need another higher Azure SQL database account permission.
HTH.
Working solution was to use the export data task:
For some reason this worked and the publish to ASQL task from SSMS didn't. I understand this is very based on the restrictions imposed by my company but at least this solution worked.
NOTE: as both Source and Destination use SQL Server Native Client .
Moreover when setting the Destination the refresh of the list of databases might not work (depending on your permissions on Server level) but if you type directly the name of the database it will work. Talking about this:

Error Migrating SQL Server Database to Azure

So I am completely new to .Net Core development, and was given a codebase that I am trying to host on Microsoft Azure. I have the local database file (.mdf) in SQL Server Management Studio, and am trying to deploy it to an Azure Database, However it keeps failing during migration and giving me this issue
Error SQL71627: The element User: [ISOCENTRIC\Administrator] has property >AuthenticationType set to a value that is not supported in Microsoft Azure SQL >Database v12.
(Microsoft.SqlServer.Dac)
However, when I SELECT * FROM master.sys.database_principals; and it dumps the db users list, the "ISOCENTRIC\Administrator" user does not appear in that list, so I cannot find a way to drop it from the DB. Is there something I am missing regarding the location of this user and how I can drop it from the db so I can migrate to Azure?
p.s. This is my first post on here so please let me know if I should make any changes to adhere to correct formatting on this forum.
Thanks in advance.
I guess the database users can't be migrated to Azure SQL DB because they are Windows users. You'll need to drop those users before you deploy this database to Azure SQL DB.
You can always backup and restore a copy of this database, remove the users, and then deploy that one to Azure SQL Db.
I figured out that my query to dump the database users was incorrect, and was able to find and drop the user causing the issue.

Why cannot login to restored SQL Server 2012 database?

As part of the effort for developing a Windows Service, I restored a production database to a test database on the same SQL Server instance, and can access the test database just fine via SSMS. I gave db_owner role to the database to two other users that are unable to login, both getting SQL error
Error: 18456, Severity: 14, State: 38.
Login valid but database unavailable (or login not permissioned)
Here is the basic message which mentions the database in question as the problem.
Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database 'MedFile_TestDataServer'. [CLIENT: ]
The database is not in "Restoring" status.
First user is NT Authority\System and the second a Windows user. Both credentials are used to run the Windows service that access the database in update mode, the system user from the same server, the Windows user from VS2013 running the service as a command program on my desktop. Both can get at other copies of this same database just by changing the database name so don't think a connection string issue. I have compared every property on the databases that work and do not work and see no differences except the file names and these two logins have less permissions on the databases that they can access.
Almost like this database is being kept unavailable after being restore but I can find no such property set on the database and I can access via SSMS. I've restarted the server containing the database ergo SQL Server as well.
I also tried running the service as a database administrator and get the same error even though that user accesses the db just fine via SSMS.
Is there anything that can make the database "unavailable"?
This is part of software development for a Windows service trying to use a test database. I am using both EF 6.02 and the latest ADO.NET version as well.
Check if your database has "Auto Close" property set to "True". If so, change it to "False".
You can see it from SSMS: right-click on database - Properties - Options.
can you check what is the Default database for those two users?
If you have (accidentally / purposefully) set a default database for the SQL Server Login user, and the user does not ahve permissions to access the database, you'll get this error.

remote procedure call failed after deleting account

Someone retired and we deleted an account associated with them on our Microsoft SQL Server 2008. We are getting "remote procedure call failed 0x800706be" and the Administrator login is not working. (And every thing else isn't working too) It seems like somehow that account was a key for the whole Microsoft SQL Server install.
We tried restoring the Microsoft backup for C (windows) and D (applications/SQL Server) drives and it didn't fix it. In fact, the deleted account didn't come back, although we had tried creating an account with the same name and hadn't deleted that fully before the restore.
Any ideas how to recover from that? The rest of the server is like this:
F: our file system/web
G: DB
Re-creating an account with the same name isn't going to work, because SQL Server uses the UID of the account and not the name for authentication.
Create a new Active Directory service account, and do a clean install of SQL Server using this new service account as the account to run SQL Server. Then, restore your database backups (including master, model, and msdb).

Resources