VT3000 - Scripting SQL Databases

From Versacall Support
Revision as of 21:33, 17 July 2019 by SupportAdmin (talk | contribs) (Created page with "=Overview= Use the instructions below to script an SQL database. This method is only needed when the user is attempting to use a newer version database in an older version. Ex...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

Use the instructions below to script an SQL database. This method is only needed when the user is attempting to use a newer version database in an older version. Example: Use a SQL Server 2017 database on an SQL 2012 Server.

Requirements

1. User must have direct access to both SQL Server Instances.

2. User login must have admin rights.

3. Make a backup of all the databases on both systems before starting.


Instructions - Exporting/Scripting Database(s)

1. Use Windows Start button - open All Programs menu - select one of the following depending on your version of SQL Server.

    SQL Server 2008 - SQL Server 2014
         a. Expand the SQL Server (your version) folder.
         b. Select SQL Server Management Studio.
    SQL Server 2017
         a. Expand the SQL Server Tools (your version) folder.
         b. Select Microsoft SQL Server Management Studio.


2. Login to SQL Server instance. If this is a VersaCall system, the default username and password are shown below. If you are using your own SQL Server, contact your IT department for more information.


3. Expand the Database folder in SQL Server.


4. Click on the VersaCall database that you want to script so that it is highlighted.


5. Right click on the selected database and select Tasks - Generate Scripts.


6. Select Next on the Generating Scripts Wizard Introduction window.


7. Ensure the "Script entire database and all database objects" is selected - click on the Next button.


8. Select "Save to File" and "Single File".


9. In the File Name field - change the "script.sql" file name to the name of the database. Example below shows "VT3000Configuration.sql". Select the Advanced button.


10. Scroll down the list of options - click on the "Script for Server Version" option - click on it so that it is highlighted.


11. Click on the down arrow in the version field - select the SQL Server version you will be moving the database to. Example shows SQL Server 2012.


12. Scroll down list of options - click on the "Types of data to script" option - click on it so that it is highlighted.


13. Click on the down arrow in the types field - select "Schema and data".


14. Click on the down arrow in the types field - select "Schema and data".


15. Double check that both settings are correct - click on the OK button.


16. Click on the Next button on the Generating Scripts Wizard window.


16. On the Summary window - ensure that the Target is correct and that the file name has been changed - click on the Next button.

17. On the Summary window - ensure that the Target is correct and that the file name has been changed - click on the Next button.


18. Repeat the steps for all of the databases that you need to script. Close SQL Server Management Studio and move to the other system/instance.


Instructions - Importing/Executing the Scripted Database(s)

Save the ".sql" files, that you made in the section above, on the computer that you want to import them to. Place the files in a location that you can navigate to easily.


1. Use Windows Start button - open All Programs menu - select one of the following depending on your version of SQL Server.

    SQL Server 2008 - SQL Server 2014
         a. Expand the SQL Server (your version) folder.
         b. Select SQL Server Management Studio.
    SQL Server 2017
         a. Expand the SQL Server Tools (your version) folder.
         b. Select Microsoft SQL Server Management Studio.


2. Login to SQL Server instance. If this is a VersaCall system, the default username and password are shown below. If you are using your own SQL Server, contact your IT department for more information.


3. Expand the Database folder in SQL Server.


NOTE: Any database that you want to import/execute from a script must be removed. If you have not made a backup of the database you are replacing, please do so before proceeding.


4. Click on the VersaCall database that you want to replace.


5. Right click on the highlighted database - select Delete.


6. On the Delete Object screen - select "Delete backup and restore history information for databases" and "Close existing connections" - click on the OK button.


7. Under the Databases folder, the database you deleted will no longer be listed..


8. Select File - Open - File.


9. Navigate to the folder that you saved the ".sql" files to - double click on a database ".sql" file.


10. The Script will appear on the screen to the right of the Object Explorer. Go to the 5th line in the script and go to the FILENAME section. The file location address must be changed to match the system it is being imported into. Below are the default locations for SQL Express. Please contact your IT department if you are using a different SQL Server location.

         2008 R2 - FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\VT3000_Configuration.mdf'
         2012 - FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\VT3000_Configuration.mdf'
         2014 - FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\VT3000_Configuration.mdf'
         2017 - FILENAME = N'C:\SQLServer2017Media\MSSQL14.SQLEXPRESS01\MSSQL\DATA\VT3000_Configuration.mdf'



11. Change the File Name address to fit the version you are using. Example below shows this for a SQL Server 2012 instance.


12. Go to the 7th line in the script and go to the FILENAME section. The log file location address must be changed to match the system it is being imported into. Below are the default locations for SQL Express. Please contact your IT department if you are using a different SQL Server location.

         2008 R2 - FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\VT3000_Configuration_log.ldf'
         2012 - FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\VT3000_Configuration_log.ldf'
         2014 - FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\VT3000_Configuration_log.ldf'
         2017 - FILENAME = N'C:\SQLServer2017Media\MSSQL14.SQLEXPRESS01\MSSQL\DATA\VT3000_Configuration_log.ldf'



13. Change the File Name address to fit the version you are using. Example below shows this for a SQL Server 2012 instance.


14. Select Execute in the tools menu at the top of the screen.


15. A Message panel will appear below the Script. At the bottom of the panel you will see a Executing Query notification. This process can take some time to complete.


16. Once the Script is completed (database replaced), you will see a message showing all the rows that were affected and a Query Executed Successfully message.


17. Click on the Database folder so that it is highlighted - right click on the folder - select Refresh.


18. The database name for the script that you executed will now appear in the list.


19. Repeat the process for all the databases you need import.


Step by Step Guides

Update Databases - SQL Server

Restore/Update Databases - VT3000

Backup Databases - SQL Server


Having Trouble?