Database backup and restore

From Dragon Age Toolset Wiki
Revision as of 23:58, 27 June 2009 by BryanDerksen (Talk | contribs) (imported from extranet)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The following command-line command will back up the database to a file on disk, assuming you're using the default database name (bw_dragonage_content):

sqlcmd -S .\BWDATOOLSET -E -Q "BACKUP DATABASE bw_dragonage_content TO DISK = 'C:\Users\Storey\DA Install\data\bw_dragonage_content.bak'"

And the following command will restore a database backup:

sqlcmd -S .\BWDATOOLSET -E -Q "RESTORE DATABASE bw_dragonage_content FROM DISK = 'C:\Users\Storey\DA Install\data\bw_dragonage_content.bak' WITH REPLACE"

If you're restoring to a data store that's in a location other than the store you made the backup from (for example if you're moving your data from one computer to another and the toolset is installed in a different location on the destination machine) you can add the following to the restore command to restore to the new location. If you're restoring to the same place you made the backup from you can omit this.

WITH MOVE 'bw_da_content_euts_Data' TO 'C:\Program Files\Dragon Age\toolssql\Data\bw_dragonage_content.mdf', MOVE 'bw_da_content_euts_Log' TO 'C:\Program Files\Dragon Age\toolssql\Data\bw_dragonage_content.ldf'