Tuesday, 4 June 2013

Data Migration between IBM Lotus Notes Database to SQL Server.

Data Migration between IBM Lotus Notes Database to SQL Server.



Recommended to take a below steps to for data migration between IBM to SQL

Below installation Required.
Step 1.  Install the  LotusNotes Software[LOTUS_Notesclient_853_WIN_EN_EVA]  which is available at internet to download.

Step2:Configure the Notes Database to LOTUS Notesclient with crediantials or without credentials.Make sure that send a test email through configured lotusnotes.

Step 3: Install the  Lotus Notes Sql Driver[Lotus Notes-SQL Driver(PARA 8.5)] Download from internet. 

Step 4:Sql Server and visual studio installation needed. 

Step 5: Next to create DSN.

Lets see how to create a dsn.

1.In Control pannel -click Administrative tools-Click-Data Sources.


















 
2.To click driver menu from odbc and choose a Lotus Notes Sql Driver(.nsf) then click ok

3. To click a File Dsn menu from the ODBC,Then click a add button which is inside layout to create a new Data source

















4.To select Lotus Notes SQL Driver(.nsf) from the new data source menu.then click next.

5.Given a  name on Data source  as per your wish(any name) 
















6. then click next, next and click finally click  finish.

7.Again go to the odbc and choose file dsn.(make sure that   your already created dsn file is available.)

8. To select a created dsn and configured to the notes DB.
( select a created dsn(Test.dsn) and click Configure to open the Lotus notes connection window, Leave it domino server name as default )






9.Click the Browse button and Map the path of your actual NotesDB Path and click ok. ok finish.

10.Let we need the connection string to acces a Notes Db database data , so open the notesdb database pointingn dsn(test.dsn) into word you will get a connection string .

Example



[ODBC]
DRIVER=Lotus Notes SQL Driver (*.nsf)
ThreadTimeout=60
MapSpecialChars=1
ShowImplicitFlds=0
MaxLongVarcharLen=512
KeepTempIdx=1
MaxVarcharLen=254
MaxRels=20
MaxStmtLen=4096
MaxSubquery=20
EncryptPWD=
UserName=
Server=local
Database=bookmark.nsf




Now you have a connection string and play with your .net or java or any languages but am going to implement through c#l Lets see,


1.Connection string in webconfig.

<add name="connection"  connectionString="DRIVER={Lotus Notes SQL Driver (*.nsf)};Database=C:/Users/WQPadm/Desktop/ontmsfest.nsf;Server=local;UserName=;MaxSubquery=20;MaxStmtLen=4096;MaxRels=20;MaxVarcharLen=254;KeepTempIdx=1;MaxLongVarcharLen=512;ShowImplicitFlds=0;MapSpecialChars=1;ThreadTimeout=60;"  providerName="System.Data.Odbc" />

<add name ="connectiontosql" connectionString ="Server=NO-DS1WEB001\VIPADMSQL; Database=RI400Meetings; User Id=VIPadm; password= Book4Res" providerName="System.Data.SqlClient" />

2.CS file(C# code):

string odbcconnection = ConfigurationManager.ConnectionStrings["connection"].ToString();
OdbcConnection con = new OdbcConnection(odbcconnection);
con.Open();
DataSet ds1 = new DataSet();
OdbcDataAdapter sqlda1 = new OdbcDataAdapter("Enjoy with your Query", con);
sqlda1.Fill(ds1, "QWW");
Laod.DataSource = ds1.Tables[0];
DataTable dt = ds1.Tables["QWW"];
File.WriteAllText(Path.Combine(newPath, "log_odbc.txt"), "ODBC Connection Made Successfull"); 


 string sqlconnection = ConfigurationManager.ConnectionStrings["connectiontosql"].ToString();
 foreach (string line in lines1)
                    {
                                   SqlConnection conne = new SqlConnection(sqlconnection);
                        conne.Open();
                        File.WriteAllText(Path.Combine(newPath, "log_Sql.txt"), "Sql Connection Made Successfull");
                        SqlCommand cmde = new SqlCommand("Play with yor Query") values('"+
Play with your Data+"' )");

//You can play
                        cmde.Connection = conne;
                        cmde.ExecuteNonQuery();
                        conne.Close();
                        File.WriteAllText(Path.Combine(newPath, "log_Data.txt"), "Data Tranfer Cpmleted");
                        }
                     }
                  
            


finally will get output in sql :