Data/Database migration in MySQL


Introduction: MySQL workbench used to migrate data from source database server to destination database server. The detail information card of MySQL Workbench is given below:

WorkBench

Figure 1: MySQLWorkBench Card

Add Source and destination server connection into Workbench.

image

Figure 2: Add Source and Destination

After adding source and destination connection.

image

Figure 3: Shows source and destination connection

Data will be migrated from Source server to Destination. So double click on the Source server. Now select migrate from the menu DatabaseàMigrate.

image

Figure 4: Choose Migrate

Now click on the start migration button.

image

Figure 5: Start Migration

Provide source information.

image

Figure 6: Provide source information

If the connection is tested successfully then click the next button. Now provide the destination information. And test it. If test successfully then click the next button.

image

Figure 7: Provide destination

Now wait for the ‘Schema Fetch list completion’. And after that click next button.

image

Figure 8: Fetch Schema list

Now select the DB to that you want to migrated from Source server to destination. After that click Next button.

image

Figure 9: Select the DB to migrate

After clicking next button wait to finish the ‘Reverse Engineer Source’.

image

Figure 10: Reverse Engineer Source

After finished click Next button. Now comes the sources object selection window, select the object that wanted to be migrated.

image

Figure 11: Source object selection

Click Next button. Now migration step starts. After finishing the selection of objects to migrate, click Next button. Manual editing step starts, in my case it results nothing. So clicking Next button. Opens the target creation option step.

image

Figure 12: Target Creation option

Now starts the ‘Create Schemata’ step. Wait to finish it. And click ‘Next Button’. Starts the ‘Create Target Results’ window. Click Next button. Opens the data transfer setup window.

image

Figure 13: Data transfer setup

After providing all the desired setup information, click Next button to start data transfer. Wait to complete the data transfer.

Advertisements

How to Install and Run JMeter.


This is just a introduction to start working on JMeter. The process to install , record and run JMeter is described in the following section :

    • Extract the downloaded file.
    • Run JMeter.bat from ExtractedFolder\apache-jmeter-2.9\apache-jmeter-2.9\bin
    • Right click on TestPlan—> Add–>Threads(Users)–>Thread Group
Add Thread Group

 

    • Change the name of the group to ABCApplicationTestThreadGroup–> Click on the TestPlan in left panel.
    • ight Click on the ‘ABCApplicationTestThreadGroup’–>Add–>Config  Element–>HTTP Cookie Manager.
Add Config Element

 

    • May change the HTTP Cookie Manager name to ‘ABC Application HTTP Cookie Manager’–> Click on the TestPlan in left panel.
  • Right Click on the ‘ABCApplicationTestThreadGroup’–>Add–>Listener–>Summary Report.
Add Listener

 

    • May change the summary report name to ‘ABCApplication test Summary Report’–> Click on the TestPlan in left panel.
    • Right Click on the ‘ABCApplicationTestThreadGroup’–>Add–>Listener–>View Results Tree.
Add View Results Tree

 

    • May change the View Results Tree name to ‘ABC Application Results Tree’–> Click on the TestPlan in left panel.
    • Right Click on the ‘WorkBench’–>Add–>Non-Test Elements–>HTTP Proxy Server.
Add Non Test Element To WorkBench

 

    • May change the name of the HTTP proxy server to ‘ABC Application test HTTP Proxy Server’–> Click on the TestPlan in left panel.
    • Change the port number to 9090
    • From browser change the connection settings

a. Tick Use proxy server.

b. Address : 127.0.0.1

c. Port : 9090

Change browser settings

 

    • Now from JMeter GUI, Click on ‘ABC Application test HTTP Proxy Server’ from left panel.
    • Click on the ‘Start’ button at the bottom of the JMeter right side panel.
Start Proxy Server

 

    • Now from the browser to which the connection settings are changed, start browsing the site that targeted to record.
    • Look on JMeter left panel ‘ABCApplicationTestThreadGroup’ node, New nodes should be added as the site is browsed.
    • So JMeter is now working to record. You may record as much as needed for the site.
    • Now stop the recording.
Stop Proxy Server

 

    • So the test is now recorded.
    • The recorded script may run now, Click the run button from the JMeter.
Run JMeter
  • After finish stop JMeter and View report, by choosing ‘Summary Report’ and ‘Results Tree’ from the left panel.
View Report

Now the recorded script can be saved from the file menu to run the test again in later time.

2012 in review


The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

600 people reached the top of Mt. Everest in 2012. This blog got about 4,100 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 7 years to get that many views.

Click here to see the complete report.

How to run a console application through ant script


Below is the ant script to run a console application by ant :

<project name="MyApplication" default="runmyapplication">

<!-- Initialization of the project. --> <target name="-init"> <!-- Load environment variables --> <property environment="env" /> <!-- Define directories in the source repository --> <!--The directory of the solution if its in the same directory as ant then only . is enough--> <property name="myapplicationexecutable.dir" location="C:\MyApplication\bin" /> <property name="msbuild" location="${env.windir}/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe" /> <property name="msbuild.logger" value="" /> <property name="myapplilcationexecutable" location="${myapplicationexecutable.dir}/myapplication.exe" /> <property name="param1" location="param1value" /> </target> <!-- Run the unit test --> <target name="runmyapplication" depends="-init"> <exec dir="${myapplicationexecutable.dir}" executable="${myapplilcationexecutable}" failonerror="true"> <arg line="${param1}"/> </exec> </target> </project>

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

How to run a console application through ant script


Below is the ant script to run a console application by ant :

<project name=”MyApplication” default=”runmyapplication”>

  <!– Initialization of the project. –>
  <target name=”-init”>
    <!– Load environment variables –>
    <property environment=”env” />

    <!– Define directories in the source repository –>
    <!–The directory of the solution if its in the same directory as ant then only . is enough–>
    <property name=”myapplicationexecutable.dir”                location=”C:\MyApplication\bin” />
    <property name=”msbuild”                location=”${env.windir}/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe” />
    <property name=”msbuild.logger”            value=”” />
    <property name=”myapplilcationexecutable”            location=”${myapplicationexecutable.dir}/myapplication.exe” />
    <property name=”param1″                location=”param1value” />
  </target>

  <!– Run the unit test –>
  <target name=”runmyapplication” depends=”-init”>
    <exec dir=”${myapplicationexecutable.dir}” executable=”${myapplilcationexecutable}” failonerror=”true”>
      <arg line=”${param1}”/>
    </exec>
  </target>
</project>

Install prepare environment for Ant and create build script.


 

Follow the steps below to prepare environment for Ant and to write simple Ant build script to build a solution :

1. Download java from the link http://java.com/en/download/index.jsp

after download install Java.

2. set the JAVA_HOME variable in environment variable.

Go to Mycomputer–>properties–>Advanced–>Click Environment Variables button–>Click New button(in the system variables section)–>

set Variable name=JAVA_HOME

Variable value=c:\program Files\java\jre6(This is the path where java is installed it may vary)–> click ok button–>By clicking ok of all the window finish it.

Set JAVA_HOME variable

3. Download ant from http://ant.apache.org/bindownload.cgi

4. Unzip the download zip file(nothing to install for ant).

5.  Now set the ANT_HOME variable in environment variable.

Go to My Computer——>properties–>Advanced——->Click Environment Variables button——->Click New button(in the system variables section)—–>set Variable name=ANT_HOME

Variable value=C:\apache-ant-1.8.3-bin\apache-ant-1.8.3(The folder path where ant is unzipped)——> click ok button—–>By clicking ok of all the window finish it.

set the ANT_HOME variable in environment variable

6. Now set the ant path.

Go to Mycomputer–>properties–>Advanced–>Click Environment Variables button–>From System variables section select Path —–> click edit button——>in the last of the text box put the bin folder of the ant(from the unzipped location)precedding with semicolon like : ‘;C:\apache-ant-1.8.3-bin\apache-ant-1.8.3\bin’

Set ant Path

7. Open command prompt and type ant it will show error message ‘build.xml does not exist’. That means environment for ant is
prepared and now its time to prepare the build script with ant.

8. Here is a simple minimal ant script to build a project. Save the build script file as build.xml

<!--The project and the default task(target) that ant will execute if no target(task) is defined-->
<project name="MCSManagement" default="compile">
  
   <!--This task(target) initializes all the project variables-->
    <target name="init">
    
        <!-- Load environment variables -->
        <property environment="env" />
        
        <!-- Define the source repository -->
    <property name="src.dir"           location="C:\Developments\MCSManagement" />
    
    <!--Path of the msbuild which will be used as compiler -->
    <property name="msbuild"        location="${env.windir}/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe" />
    
    <!--Full path of the solution file that have to compile-->
    <property name="sln.file"       location="${src.dir}/MCSManagement.sln" />
    
  </target>
  
  <!--This target(task) compiles the project and initializes all the needed variables.This target(task) is dependent on the init target-->
  <target name="compile" depends="init">
    <!--Directory is the directory where the solution file is located-->
    <exec dir="${src.dir}" executable="${msbuild}" failonerror="true">
      <!--The path of the solution file-->
      <arg line="${sln.file}"/>
    </exec>
  </target>
  
</project>

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

9. Now start the command prompt, use cd to enter the location where the build.xml is located. Now to build the solution enter the command "ant compile"

ant command

How to add script reference in Master Page to make accessible from all the directory


To add script file reference in master page to make it accessible from all the pages from all the directory of the website , add the script reference in the following way :

Suppose the web structure is as follows :

Structure of the WebSite

add following lines to masterpage.master

<head runat=”server”>
    <title></title>
    <script type=”text/javascript” src='<%#ResolveUrl(“~/JQuery/jquery-ui-1.8.17.custom/js/jquery-1.7.1.min.js” ) %>’ ></script>
    <script type=”text/javascript” src='<%#ResolveUrl(“~/JQuery/jquery-ui-1.8.17.custom/js/jquery-ui-1.8.17.custom.min.js” ) %>’ ></script>
</head>

And then add Page.Header.DataBind();  in the OnLoad method of the MasterPage.master.cs file :

protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        Page.Header.DataBind();
    }

 

Thats it, now functionality from the script files are available to all the files in the website that uses the master page.