A friend has a software, which uses a MsSQL Express Database. Now we
want to move this DB to his Server which runs SQL-Server.
How to do that?
Tim Ritberg (tim@server.invalid) writes:
A friend has a software, which uses a MsSQL Express Database. Now we
want to move this DB to his Server which runs SQL-Server.
How to do that?
What does "SELECT @@version" report for the two instances?
Can't login today. The server instance is a Linux MsSQL 15.
On Desktop is a (Express) SQL Server 2016 SP1.
Tim Ritberg (tim@server.invalid) writes:
Can't login today. The server instance is a Linux MsSQL 15.
On Desktop is a (Express) SQL Server 2016 SP1.
So the server is of a later version that the the Express instance. That's good, because then you can use BACKUP/RESTORE.
BACKUP DATABASE db TO DISK = 'C:\temp\backup.bak' WITH INIT
And then on the server:
RESTORE DATABASE db FROM DISK = '/path/backup.bak'
WITH MOVE 'db' TO '<path>',
MOVE 'db_log' TO '<path>'
When it comes to the names that follow MOVE, these are the logical names of the devices. They often follow the pattern shown here, but this is not
always the case. Run sp_helpdb on the database on the source server to
see the names. They are in the first column of the second result set.
And what about users/permissions etc?
Tim Ritberg (tim@server.invalid) writes:
And what about users/permissions etc?
Quoting Books Online:
BACKUP DATABASE and BACKUP LOG permissions default to members of the
sysadmin fixed server role and the db_owner and db_backupoperator fixed database roles.
If the database being restored does not exist, the user must have CREATE DATABASE permissions to be able to execute RESTORE. If the database exists, RESTORE permissions default to members of the sysadmin and dbcreator fixed server roles and the owner (dbo) of the database.
I guess, I would use admin account.
Tim Ritberg (tim@server.invalid) writes:
I guess, I would use admin account.
Yeah, that is what I would expect too. And in that case, you don't need
to worry about permissions. In SQL Server at least. Possibly there can
be issues in the file system.
But this application should not use an admin account, so I have to
transfer user from express to server.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 228:10:20 |
Calls: | 6,624 |
Calls today: | 6 |
Files: | 12,171 |
Messages: | 5,318,991 |