26.11.2014 Views

Migrating a PostgreSQL Database to SQL Anywhere 12 - Sybase

Migrating a PostgreSQL Database to SQL Anywhere 12 - Sybase

Migrating a PostgreSQL Database to SQL Anywhere 12 - Sybase

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Migrating</strong> a <strong>Postgre<strong>SQL</strong></strong> database <strong>to</strong> a <strong>SQL</strong> <strong>Anywhere</strong><br />

database<br />

<strong>Migrating</strong> data from <strong>Postgre<strong>SQL</strong></strong> <strong>to</strong> <strong>SQL</strong> <strong>Anywhere</strong> is a straightforward process, with minor issues occurring<br />

only if you are using the <strong>Postgre<strong>SQL</strong></strong>-specific data types mentioned previously. Data migration can be<br />

accomplished using the Data Migration wizard that is part of <strong>Sybase</strong> Central. Alternatively, a more cus<strong>to</strong>mized<br />

migration can be done using the sa_migrate set of s<strong>to</strong>red procedures in <strong>SQL</strong> <strong>Anywhere</strong>. The <strong>Postgre<strong>SQL</strong></strong>dump<br />

utility, coupled with the <strong>SQL</strong> <strong>Anywhere</strong> LOAD TABLE statement, could also be used <strong>to</strong> migrate the data. Note<br />

that if the <strong>Postgre<strong>SQL</strong></strong> SET or ENUM data types are used in the <strong>Postgre<strong>SQL</strong></strong> database, you may have some<br />

additional considerations when migrating your <strong>Postgre<strong>SQL</strong></strong> database <strong>to</strong> <strong>SQL</strong> <strong>Anywhere</strong>. For information about<br />

these data types and the differences from <strong>SQL</strong> <strong>Anywhere</strong>, see “Data types” on page 3.<br />

Requirements<br />

• This document assumes you have a <strong>Postgre<strong>SQL</strong></strong> database running on any of its supported platforms<br />

and <strong>SQL</strong> <strong>Anywhere</strong> <strong>12</strong> installed on any of the supported Windows platforms.<br />

• If you have not created a <strong>Postgre<strong>SQL</strong></strong> database, you can create a few tables in the <strong>Postgre<strong>SQL</strong></strong> test<br />

database <strong>to</strong> walk through the migration steps.<br />

• The <strong>Postgre<strong>SQL</strong></strong> ODBC 5.1 (or later) driver must also be installed on the computer running the <strong>SQL</strong><br />

<strong>Anywhere</strong> database.<br />

Creating a <strong>SQL</strong> <strong>Anywhere</strong> database<br />

You must first create a <strong>SQL</strong> <strong>Anywhere</strong> database <strong>to</strong> migrate the <strong>Postgre<strong>SQL</strong></strong> database <strong>to</strong>. The following steps<br />

explain how <strong>to</strong> create a new database using <strong>Sybase</strong> Central.<br />

1. Start <strong>Sybase</strong> Central. From the Start Menu, choose Program <strong>SQL</strong> <strong>Anywhere</strong> <strong>12</strong> <br />

Administration Tools <strong>Sybase</strong> Central.<br />

2. Create a new <strong>SQL</strong> <strong>Anywhere</strong> <strong>12</strong> database. Choose Tools <strong>SQL</strong> <strong>Anywhere</strong> <strong>12</strong> Create <strong>Database</strong>.<br />

Follow the instruction in the wizard <strong>to</strong> create a new database.<br />

Creating a data source for the <strong>Postgre<strong>SQL</strong></strong> database<br />

The migration process requires an ODBC connection <strong>to</strong> the source database. Therefore, you need <strong>to</strong> create an<br />

ODBC data source (DSN) for the <strong>Postgre<strong>SQL</strong></strong> database.<br />

1. Download and install the <strong>Postgre<strong>SQL</strong></strong> ODBC 5.1 driver if you have not already done so. The most<br />

recent driver is located at http://dev.<strong>Postgre<strong>SQL</strong></strong>.com/downloads/connec<strong>to</strong>r/odbc/.<br />

2. From <strong>Sybase</strong> Central, choose Tools <strong>SQL</strong> <strong>Anywhere</strong> <strong>12</strong> Open ODBC Administra<strong>to</strong>r. The ODBC<br />

Data Source Administration dialog appears.<br />

3. Click Add <strong>to</strong> add a new DSN. The Create New Data Source wizard appears.<br />

4. Select the <strong>Postgre<strong>SQL</strong></strong> ODBC 5.1 Driver from the list of available drivers and then click Finish. The<br />

<strong>Postgre<strong>SQL</strong></strong> ODBC 5.1 Driver - DSN Configuration dialog appears.<br />

5. Type a name for the data source in the Data Source Name field. For example, name the data source<br />

‘<strong>Postgre<strong>SQL</strong></strong> migrate’.<br />

6. Supply the server name, user ID, password, and database name on the logic page of the <strong>Postgre<strong>SQL</strong></strong><br />

ODBC Connec<strong>to</strong>r dialog.<br />

7. Click the Test Data Source but<strong>to</strong>n <strong>to</strong> ensure you have configured the data source correctly.<br />

6 <strong>Migrating</strong> a <strong>Postgre<strong>SQL</strong></strong> <strong>Database</strong> <strong>to</strong> <strong>SQL</strong> <strong>Anywhere</strong> <strong>12</strong><br />

December 2011

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!