Transfer a SQL Database to new SQL Server

Let’s say you want to update your current DotNetNuke portal to a newer version. Then you shouldn’t do it in the production environment. But when you restore the database backup on the development database server the database logins with SQL users do not work anymore.

Microsoft has published a knowledge base article on transferring SQL logins from one server to another.

  1. Create a custom stored procedure to export the current login information at the source server
  2. Create a new login on the target SQL server for the database you intend to migrate

When you run the SQL script to create the stored procedures, make sure that you add the SPs to the master database.

Transfer SQL database to new SQL server

The SP sp_help_revlogin generates a SQL login script for each login available on the source server at the time of execution. Just copy the login script for the required user to the development server and execute the script.

EXEC sp_help_revlogin

Create login


It contains the password hash, and this makes it possible to create a new login with the same (still unknown) password from the old login. Since this is only a password hash and not the actual password, this won’t actually corrupt the security of your account. Restore your database backup to the development server.

Now run the generated SQL login script on the development server. In this stage, you have transferred SQL login, which is known to the server itself, and a database user, which is known to the database.

To connect the login with the user, execute the following command in the context of your restored database:


To access the restored database for any other DotNetNuke update and upgrade fun, change the database server name in the web.config of your web application.

Yes, the DotNetNuke web application should be copied from the production server to the development server.


Enjoy SQL Server.

Kommentar verfassen

Klicken Sie auf den unteren Button, um den Inhalt von zu laden.

Inhalt laden

%d Bloggern gefällt das: