Schema Migration

After resolving errors in your schemas, you can use the schemas with a client application such as pgAdmin, ToadEdge, or the PSQL client, or migrate the schema to an EDB Postgres Advanced Server.

Note!! Note

For more information about using Toad Edge with EDB Postgres Advanced Server, see Toad Edge for Postgres.

You can choose one of the following options for migrating schemas; migrate to an:

  • Existing on-premises EDB Postgres Advanced Server

  • New on-premises EDB Postgres Advanced Server

  • EDB Postgres Advanced Server on Cloud

Schema migration home page

Schema migration home page

Figure 3-14: Schema migration home page

Migrating to an Existing On-Premises EDB Postgres Advanced Server Host

You can migrate schemas to an existing on-premises EDB Postgres Advanced Server on Windows or Linux platforms.

Migrating Schemas on Windows

  1. Select the Existing on-premises EDB Postgres Postgres Advanced Server option:

Existing on-premises EDB Postgres Advanced Server home page

Existing on-premises EDB Postgres Advanced Server home page

Figure 3-15: Existing on-premises EDB Postgres Advanced Server home page

  1. Select one or more schemas to migrate to EDB Postgres Advanced Server:

Selecting schemas for migration

Selecting schemas for migration

Figure 3-16: Selecting schemas for migration

Note!! Note If your schemas are not 100% compatible, a banner will be displayed as shown; complete the Contact Us form for any assistance required.

The Contact Us form

The Contact Us form

Figure 3-17: The Contact Us form

  1. Download the assessed schemas:

Download the assessed schemas

Download the assessed schemas

Figure 3-18: Download the assessed schemas

  1. Click on Windows:

Selecting Windows operating system

Selecting Windows operating system

Figure 3-19: Selecting Windows operating system

  1. To import the schemas, run the following command:

  • On CLI

\i c:\users\...\<project_name>.sql
  • On cmd/shell

edb-psql -f <project_name>.sql

Note!! Note You can also use pgAdmin instead.

The converted schemas are migrated to the target server.

A successful migration

A successful migration

Figure 3-20: A successful migration

Migrating Schemas on Linux

To migrate schemas to an existing on-premises EDB Postgres Advanced Server on Linux, complete the following steps:

  1. Click the Existing on-premises EDB Postgres Advanced Server option:

Existing on-premises EDB Postgres Advanced Server home page

Existing on-premises EDB Postgres Advanced Server home page

Figure 3-21: Existing on-Premises EDB Postgres Advanced Server home page

  1. Select one or more schemas to migrate to EDB Postgres Advanced Server:

Selecting schemas for migration

Selecting schemas for migration

Figure 3-22: Selecting schemas for migration

  1. Download the assessed schemas:

Download the assessed schemas

Download the assessed schemas

Figure 3-23: Download the assessed schemas

  1. Click on Linux:

Selecting Linux operating system

Selecting Linux operating system

Figure 3-24: Selecting Linux operating system

  1. To import the schemas, invoke the following edb-psql client commands:

sudo su - enterprisedb
edb-psql edb
create database <database_name>;
\\connect <database_name>
\\i <project_name>.sql

Note!! Note You can optionally use the pgAdmin client for the import.

The converted schemas are migrated to the target server.

A successful schema migration

A successful schema migration

Figure 3-25: A successful schema migration

Migrating to a New On-Premises EDB Postgres Advanced Server Installation

You can install new EDB Postgres Advanced Server on-premises on Windows or Linux platforms and migrate the schemas.

Migrating Schemas on Windows

To migrate schemas to a new on-premises EDB Postgres Advanced Server on Windows, complete the following steps:

  1. Click New on-premises EDB Postgres Postgres Advanced Server option.

New on-premises EDB Postgres Advanced Server home page

New on-premises EDB Postgres Advanced Server home page

Figure 3-26: New on-premises EDB Postgres Advanced Server home page

  1. Select one or more schemas to migrate on EDB Postgres Advanced Server.

Selecting schemas for migration

Selecting schemas for migration

Figure 3-27: Selecting schemas for migration

  1. Select the Windows operating system.

Selecting Windows operating system

Selecting Windows operating system

Figure 3-28: Selecting Windows operating system

  1. Download Windows Installer.

Downloading Windows installer

Downloading Windows installer

Figure 3-29: Downloading Windows installer

  1. For installation steps, click EDB Postgres Advanced Server Installation Guide for Windows.

View Windows installation guide

View Windows installation guide

Figure 3-30: A successful schema migration

  1. Download the assessed schemas.

Downloading the assessed file

Downloading the assessed file

Figure 3-31: Downloading the assessed file

  1. You can import schemas by running the following command:

    • On CLI

\i c:\users\...\<project_name>.sql
-   On cmd/shell
edb-psql -f <project_name>.sql
Importing schemas into EDB Postgres Advanced Server

Importing schemas into EDB Postgres Advanced Server

Figure 3-32: Importing schemas into EDB Postgres Advanced Server

Note!! Note You can also use pgAdmin instead.

The schemas are migrated to the target server.

Figure 3-33: Importing schemas into EDB Postgres Advanced Server

Migrating Schemas on Linux

To migrate schemas to an on-premises EDB Postgres Advanced Server on Linux, complete the following steps:

  1. Click New On-premises EDB Postgres Advanced Server option.

Migrating schemas home page

Migrating schemas home page

Figure 3-34: Migrating schemas home page

  1. Select one or more schemas to migrate on EDB Postgres Advanced Server.

Selecting schemas for migration

Selecting schemas for migration

Figure 3-35: Selecting schemas for migration

  1. Select the Linux operating system.

Selecting Linux operating system

Selecting Linux operating system

Figure 3-36: Selecting Linux operating system

  1. You can select one of the following options to install the EDB Postgres Advanced Server:

    • Repository

    • More options

    Selecting Linux repository

    Selecting Linux repository

    Figure 3-37: Selecting Linux repository

  2. For information on the installation procedure, click EDB Postgres Advanced Server Installation Guide for Linux:

Selecting Linux installation guide

Selecting Linux installation guide

Figure 3-38: Selecting Linux installation guide

  1. Download the assessed schemas:

Downloading the assessed schemas

Downloading the assessed schemas

Figure 3-39: Downloading the assessed schemas

  1. To import the schemas, run the following command:

sudo su - enterprisedb
edb-psql edb
create database <database_name>;
\connect <database_name>
\i <project_name>.sql
Importing schemas into EDB Postgres Advanced Server

Importing schemas into EDB Postgres Advanced Server

Figure 3-40: Importing schemas into EDB Postgres Advanced Server

Note!! Note You can also use pgAdmin instead.

The converted schemas are migrated to the target server.

A successful schema migration

A successful schema migration

Figure 3-41: A successful schema migration

Migrating to the Cloud

To migrate schemas on EDB Postgres Advanced Server to Cloud, complete the following steps:

  1. Click EDB Postgres Advanced Server on Cloud option:

EDB Postgres Advanced Server on Cloud

EDB Postgres Advanced Server on Cloud

Figure 3-42: EDB Postgres Advanced Server on Cloud

  1. Select one or more schemas to migrate to EDB Postgres Advanced Server:

Selecting schemas for migration

Selecting schemas for migration

Selecting schemas for migration

  1. Select the cloud platform. For example, IBM Cloud:

Selecting cloud option for migration

Selecting cloud option for migration

Figure 3-43: Selecting cloud option for migration

  1. To launch a new cluster, click Go to Cloud:

Launching a cloud cluster

Launching a cloud cluster

Figure 3-44: Launching a cloud cluster

Or, if you have an existing cluster running, click Next.

  1. Enter the required connection details on the Connect page:

Connecting to the cloud cluster

Connecting to the cloud cluster

Figure 3-45: Connecting to the cloud cluster

Note!! Note You can click Edit Connection to make changes to the connection details and retest the connection details.

  1. Click Test Connection to verify the connection details:

Verify the connection details

Verify the connection details

Figure 3-46: Verify the connection details

  1. Once the connection is successful, click Next:

A successful migration

A successful migration

Figure 3-47: A successful migration

The converted schemas are migrated to the target server.