/
How to backup a MS SQL Server database

How to backup a MS SQL Server database

This document explains how to create a backup of a database running on an SQL Server instance.

(1) Open a command line cmd.exe and connect to the instance using osql

C:\ ... > osql -U sa -P netxnetx_123456
1> 

Replace username and password according to your installation.

In some cases connecting requires specific naming of the instance. The instance used by the Core Server by default is named NETX_SERVER_SQL and runs on the localhost.

C:\ ... > osql -U sa -P netxnetx_123456 -S .\NETX_SERVER_SQL
1> 

(2) Find the name of the database to backup:

1> SELECT name FROM master.sys.databases
2> GO

This will give you a list of available databases. Following database name's prefixes are used:

  • netx_: BMS Server 2.0 workspaces
  • netx4_: BMS Platform workspaces before R1 Build 2000
  • netx_ef_: BMS Platform workspaces from R1 Build 2000

The database name is comprised by the prefix and the name of the server workspace.


(3) Run the backup

1> BACKUP DATABASE <your-db-name> TO DISK = '<your-db-name>.bak'
2> GO

The output can be found in the SQL Server instance's backup directory, e.g. C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.NETX_SERVER_SQL\MSSQL\Backup.


Related pages