Contents
Objective
The objective of this guide is to indicate a method of migrating data from a base with collation different than the standard "Latin1_General_CI_AS" required for the proper use of the Fluig base.
Data Migration and Conversion Procedure
The following is a checklist for Fluig conversion.
- Check procedures for the service/instance of the SGBD
Microsoft SQL Server,
describe in the following page: Configuration
of the SQL Server data bank.
- Create a new data base with grouping (Collate/Collation)
Latin1_General_CI_AS.
Immediately after creation, with no connection in this data base, execute the command:
ALTER DATABASE [fluig] SET READ_COMMITTED_SNAPSHOT ON;
The configurations for grouping of characters (Collate/Collation) of the data bases may still be queried through the following instruction:
SELECT [name] , [is_read_committed_snapshot_on] , [collation_name] FROM [sys].[databases] WHERE [name] LIKE 'fluig%';
- Install the latest version of Fluig and configure it to point
to this data base (fluig).
- Start the Fluig service, and observe the LOG to make sure
that the
service started correctly, without any serious errors, such as
failure to connect with
SGBD.
- After the service has finished starting up (with the message
"== FLUIG STARTED AND RUNNING RIGHT NOW ==" reported in the LOG),
interrupt the Fluig service.
- Generate a DUMP of this data base, with the entire structure
of tables and fields.
For the SGBD Microsoft SQL Server, use the following procedure:
- Move the mouse over the database and click on the right button.
- In the drop-down menu, choose Tasks > Generate Scripts...
- Click on Next > to see the presentation Introducing Generate and Post Scripts wizard.
- Check Generate script for entire data base and all data base objects and click Next >.
- In the following screen, in the Output Type group, and in the group below, select Save in the new query window.
- Click on Advanced.
- In the Advanced Script Options screen, change the option Grouping Scripts to True and click on OK.
- When returning to the Generate and Post Scripts screen, click on Next >.
In the next step, adjust the configurations to generate a script of the base. Click on Next >.
Go back to the Microsoft SQL Server Management Studio window.
In the new window open with the script, comment/remove the first few lines, up to the USE [fluig] instruction.
Select and delete all tables in this new database.
Execute the script DUMP generate in this new database in order to create the entire structure with no records.
Proceed with constraints in the database tables. For the SGBD Microsoft SQL Server, use the following instruction:
Open a New Query window (menu File > New > Database Mechanism Query);.
Insert the query below and execute it in the new database.
DECLARE @TABLENAME VARCHAR(8000) DECLARE @TABLENAME_HEADER VARCHAR(8000) DECLARE TNAMES_CURSOR CURSOR FOR SELECT [name] from [sys].[tables] OPEN TNAMES_CURSOR FETCH NEXT FROM TNAMES_CURSOR INTO @TABLENAME WHILE (@@FETCH_STATUS <> -1) BEGIN IF (@@FETCH_STATUS <> -2) BEGIN SELECT @TABLENAME_HEADER = 'ALTER TABLE ' + RTRIM(UPPER(@TABLENAME)) + ' NOCHECK CONSTRAINT ALL;' --Change NOCHECK to CHECK and then enable constraints PRINT @TABLENAME_HEADER END FETCH NEXT FROM TNAMES_CURSOR INTO @TABLENAME END SELECT @TABLENAME_HEADER = '--************* End of Tables *************--' PRINT @TABLENAME_HEADER PRINT ' ' DEALLOCATE TNAMES_CURSOR
Copy the result, paste it in a New Query window and execute it (in the new database).
With the Fluig services interrupted, import the data from the old database, using, for example, an import and export data wizard. For the SGBD Microsoft SQL Server, use the following procedure:
Move the mouse over the new database and click on the right button.
In the drop-down menu, select Tasks > Import Data...
In the introductory screen for the SQL Server Import and Export Wizard, click on Next >.
In the field Data source, select SQL Server Native Client (the version number is displayed at the end, use the same number as the data bank service version).
In the field Server name, enter the server (enter or select from drop-down box) and the instance that has the previous database (which must be reconciled / normalized).
In the Authentication group, use the method that allows access to all data from this previous database. A user with db_owner permission is recommended.
In the field Database, select or enter the previous base and click on Advance >.
In the screen with the header Choose a Target, the fields with access information to this new database should be automatically filled out. Correct any incorrect or incomplete information and click Next >.
In the screen with the header Specify Copy or Table Query, select Copy data from one or more tables or views and click Next >.
In the screen with the header Select Tables and Source Views, click on the first selection box in the headers of the Tables and views list.
With all options checked, click Edit Mappings...
In the box Transfer Settings, check the box Enable insertion of identity and OK.
Back to the previous window, Select Tables e Source Views, click on Next >.
In the screen with the header Review Data Type Mapping, click Next.
In the screen with the header Execute Package, check Execute immediately and click Next >.
In the screen with the header Conclude Wizard, review the actions taken and click Next.
The following screen, displaying execution of the actions, should also display a message that import was successful.
Perform access permissions transfer procedure to the appropriate users in the new database. These permissions may have been lost.
Delete the temporary directories (tmp, log and data), located in the path <INSTALL_FLUIG>/jboss/standalone.
In the setting file, located in the path <INSTALL_FLUIG>/jboss/standalone/standalone.xml, change the setting for access to the database to use of the new database.
Restart the service.
Perform the desired validation and use the new installation.