Database migration

From Dragon Age Toolset Wiki
Jump to: navigation, search
Ambox warning yellow.png
Caution: When installing a new version of the toolset over the old version, make sure to tell the installer not to overwrite the existing database unless you want to wipe the resources there and start fresh. If you want to preserve your existing work, you'll need to leave the existing database intact and then after installing you'll need to run a migration script to bring the database format up to date.

Note also that the migration script may not work correctly on Vista when UAC is enabled. A workaround for this issue has not been found; if you're running Vista you may need to disable UAC (which requires a reboot) before you can successfully run the migration script.

See http://support.microsoft.com/kb/929907 for more detail on this issue.

Database version 170 to 175

The tools needed for this are found on the sftp site:

  • MigrateProcess.bat - Gets the Database Server Name from the registry and then calls ExecuteMigrationScript.bat passing as parameters the server name and the migration.sql file name
  • ExecuteMigrationScript.bat - takes two parameters, Server name and migration script.sql name
  • Migration-1.0.0.170-1.0.0.175.sql - this name will change with each version we release.

If you've installed your toolset with the default location and default database name, updating your database is very simple; just double-click on the "MigrateProcess" batch file.

If you've used a non-default server name you may need to run the "ExecuteMigrationScript" batch file with the server name and migration script as parameters:

ExecuteMigrationScript %ServerName% Migration-1.0.0.170-1.0.0.175.sql

If you change the database name you will have to change the Migration Script sql file.

Backing up your database

Should you want to back up your database, you'll need to enter a few commands to the database server.

Starting from a DOS prompt, type:

sqlcmd –S.\bwdatoolset

When the prompt comes up 1>, enter

backup database bw_dragonage_content to disk="<Directory & File Name>"

GO

Also, bear in mind that some resources (such as art resources) are not included in your database; they are stored as files on your hard drive. Keep track of where you've put these and, if they're in a directory that might be affected by reinstallation of the toolset, make backups of these too.

The exported version exists as a file in the override directory. This directory gets emptied by default when a new version is installed. If you haven't backed up the directory's contents you will need to reexport the resources into game format.

Behind the scenes

In a nutshell, a database is just a single file. In the case of SQL Express there is also an engine that needs to run to interface with that file. When you install our toolset it installs the database engine and creates a new file. When you run the installer again it is smart enough to know that you have the engine already installed and will not install it again. You have the option of unchecking this part of the install. You also have the option to create a new file if you want.

If you do not create a new file then you have to run the migration script on your old file for the new toolset executable to work with your old file.

Uninstallation is done by the Microsoft uninstaller so we can't say for certain what will be kept around.

By default the database name we use is bw_dragonage_content and that is what the migration script is keyed off of. If you change it then you will have to modify the migration script to reflect that.

If you run the toolset configuration tool, the file location for the Win32 game build is where the final game resources exist. The other tab is used to specify which database server and database file to point to.