Skip to content

Commit

Permalink
Merge pull request #2807 from EnterpriseDB/docs/migration-portal/merg…
Browse files Browse the repository at this point in the history
…ing-procedures-schema-migration-perge

Merging procedures with similar instructions in Migration Portal
  • Loading branch information
drothery-edb authored Sep 2, 2022
2 parents 4ef1c1d + 1c02e63 commit 9370bd1
Showing 4 changed files with 69 additions and 139 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Performing a schema extraction"

navTitle: "Schema extraction"
legacyRedirectsGenerated:
# This list is generated by a script. If you need add entries, use the `legacyRedirects` key.
- "/edb-docs/d/edb-postgres-migration-portal/user-guides/user-guide/3.0.1/mp_schema_extraction.html"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Performing a schema assessment"

navTitle: "Schema assessment"

legacyRedirectsGenerated:
# This list is generated by a script. If you need add entries, use the `legacyRedirects` key.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Schema migration"

title: "Performing a schema migration"
navTitle: "Schema migration"

legacyRedirectsGenerated:
# This list is generated by a script. If you need add entries, use the `legacyRedirects` key.
@@ -9,224 +9,154 @@ legacyRedirectsGenerated:

<div id="mp_schema_migration" class="registered_link"></div>

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

You can migrate to any of these schemas:
After resolving errors in your schemas, you can migrate the schemas to an EDB Postgres Advanced Server cluster (i.e., instance).

The Migration Portal provides guided steps for migrating your schemas to one of the following target database options:

- Existing on-premises EDB Postgres Advanced Server
- New on-premises EDB Postgres Advanced Server
- EDB Postgres Advanced Server in the cloud

The first two options above lead to the creation of Data Definition Language (DDL) SQL files which can be used to perform an offline and manual loading of the schemas into the target database using a client application such as the psql client, pgAdmin, or Toad Edge. The third option above provides the ability to perform an online migration of the schemas to the target database by directly connecting to the target database.

<div id="existing_on_premises_edb_advanced_server" class="registered_link"></div>

## 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.

### Migrate schemas on Windows

1. Select **Existing on-premises EDB Postgres Postgres Advanced Server**.
1. Select **Existing on-premises EDB Postgres Postgres Advanced Server**.

1. Select one or more schemas to migrate to EDB Postgres Advanced Server. You can also expand a schema and select specific object types under each schema.
1. Select one or more schemas to migrate to EDB Postgres Advanced Server. You can also expand a schema and select specific object types under each schema.

![Schema and objects are selected](../images/schema_object_selection.png)

!!!Note
!!! Note
If your schemas aren't 100% compatible, a banner appears. Complete the Contact Us form as needed.

1. To download the assessed schemas, select **Download SQL file**.

1. Extract the downloaded zip file. The zip package consists of SQL files with DDLs for your selected schemas and objects. The DDLs are grouped in SQL files by project, schemas, or objects.
1. Select **Download SQL file**, to download the assessed schema. The zip package consists of SQL files with DDLs for your selected schemas and objects. The DDLs are grouped in SQL files by project, schemas, or objects.

| SQL file naming convention | Description | Example |
| File name | Description | Example |
|------------------------------------------------|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| *&lt;ProjectName>* _ALL_OBJECTS.sql | A single consolidated file consisting of DDLs for all your selected schemas and objects. | **AllTestMigration_ALL_OBJECTS.sql** will consist of DDLs for all objects of schemas OE, SH, IX, and PM, and only selected objects of schema HR. |
| *&lt;SchemaName>* .sql | One or more files, each consisting of DDLs for selected objects in a particular schema. | **HR.sql** will consist of DDLs for all the selected objects of the HR schema. |
| *&lt;SchemaName>* &#95; *&lt;ObjectType>* .sql | One or more files, each consisting of DDLs for a single selected object. | **HR_TABLE.sql** will consist of DDLs only for TABLE object of the HR schema. |

1. Select **Windows**.

1. To import the schemas, run:
1. Import the schema into your target database:

- On CLI:
1. Use the edb psql command line utility to connect to the EDB Postgres Advanced Server database from where the converted schema is to be migrated.

```text
\i c:\users\...\<sql_file_name>.sql
```
1. Create a new database:

- On cmd/shell:
```SQL
CREATE DATABASE <database_name>;
```

```text
edb-psql -f <sql_file_name>.sql
```

!!! Note
You can alternatively use the `pgAdmin` client for the import.

The converted schemas migrate to the target server.
1. Connect to the new database using the following psql command:

```SQL
\connect <database_name>
```

### Migrate schemas on Linux
1. Import the required SQL files into the new database using the following psql command:

You can migrate schemas to an existing on-premises EDB Postgres Advanced Server on Linux.
```SQL
\i <path_to_exported_schema_file>.sql
```

1. Select **Existing on-premises EDB Postgres Advanced Server**.

1. Select one or more schemas to migrate to EDB Postgres Advanced Server. You can also expand a schema and select specific object types under each schema.

![Schema and objects are selected](../images/schema_object_selection.png)

1. To download the assessed schemas, select **Download SQL file**.

1. Extract the downloaded zip file. The zip package consists of SQL files with DDLs for your selected schemas and objects. The DDLs are grouped in SQL files by project, schemas, or objects.

| SQL file naming convention | Description | Example |
|------------------------------------------------|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| *&lt;ProjectName>* _ALL_OBJECTS.sql | A single consolidated file consisting of DDLs for all your selected schemas and objects. | **AllTestMigration_ALL_OBJECTS.sql** will consist of DDLs for all objects of schemas OE, SH, IX, and PM, and only selected objects of schema HR. |
| *&lt;SchemaName>* .sql | One or more files, each consisting of DDLs for selected objects in a particular schema. | **HR.sql** will consist of DDLs for all the selected objects of the HR schema. |
| *&lt;SchemaName>* &#95; *&lt;ObjectType>* .sql | One or more files, each consisting of DDLs for a single selected object. | **HR_TABLE.sql** will consist of DDLs only for TABLE object of the HR schema. |

1. Select **Linux**.

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

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

!!! Note
You can alternatively use the `pgAdmin` client for the import.
!!! Note
You can alternatively use the `pgAdmin` client for the import.1. Import the schema into your target database:

The converted schemas migrate to the target server.


<div id="new_on_premises_edb_advanced_server" class="registered_link"></div>

## 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.

### Migrate schemas on Windows
1. Select **New on-premises EDB Postgres Postgres Advanced Server**.

Migrate schemas to a new on-premises EDB Postgres Advanced Server on Windows.

1. Select **New on-premises EDB Postgres Postgres Advanced Server**.

1. Select one or more schemas to migrate to EDB Postgres Advanced Server. You can also expand a schema and select specific object types under each schema.
1. Select one or more schemas to migrate to EDB Postgres Advanced Server. You can also expand a schema and select specific object types under each schema.

![Schema and objects are selected](../images/schema_object_selection.png)

1. For the operating system, select **Windows**.

1. Select **Download Windows installer**.

1. For installation steps, select **EDB Postgres Advanced Server Installation Guide for Windows**.
1. Select your operating system.
- For Windows:
Select **Download Windows installer**. See [EDB Postgres Advanced Server installation for Windows](/epas/14/epas_inst_windows) for information on the installation procedure.

1. To download the assessed schemas, select **Download SQL file**.
- For Linux:

Select either **Repository** or **More options** to install the EDB Postgres Advanced Server. See [EDB Postgres Advanced Server installation for Linux](/epas/14/epas_inst_linux/index.mdx) for information on the installation procedure.

1. Extract the downloaded zip file. The zip package consists of SQL files with DDLs for your selected schemas and objects. The DDLs are grouped in SQL files by project, schemas, or objects.
1. Select **Download SQL file**, to download the assessed schema. The zip package consists of SQL files with DDLs for your selected schemas and objects. The DDLs are grouped in SQL files by project, schemas, or objects.

| SQL file naming convention | Description | Example |
| File name | Description | Example |
|------------------------------------------------|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| *&lt;ProjectName>* _ALL_OBJECTS.sql | A single consolidated file consisting of DDLs for all your selected schemas and objects. | **AllTestMigration_ALL_OBJECTS.sql** will consist of DDLs for all objects of schemas OE, SH, IX, and PM, and only selected objects of schema HR. |
| *&lt;SchemaName>* .sql | One or more files, each consisting of DDLs for selected objects in a particular schema. | **HR.sql** will consist of DDLs for all the selected objects of the HR schema. |
| *&lt;SchemaName>* &#95; *&lt;ObjectType>* .sql | One or more files, each consisting of DDLs for a single selected object. | **HR_TABLE.sql** will consist of DDLs only for TABLE object of the HR schema. |

1. You can import schemas by running:

- On CLI

```text
\i c:\users\...\<sql_file_name>.sql
```

- On cmd/shell

```text
edb-psql -f <sql_file_name>.sql
```

!!! Note
You can alternatively use the `pgAdmin` client for the import.


### Migrate schemas on Linux
1. Import the schema into your target database:

Migrate schemas to an on-premises EDB Postgres Advanced Server on Linux.
1. Use the edb psql command line utility to connect to the EDB Postgres Advanced Server database from where the converted schema is to be migrated.

1. Select **New On-premises EDB Postgres Advanced Server**.
1. Create a new database:

1. Select one or more schemas to migrate to EDB Postgres Advanced Server. You can also expand a schema and select specific object types under each schema.

![Schema and objects are selected](../images/schema_object_selection.png)
```SQL
CREATE DATABASE <database_name>;
```

1. For the operating system, select **Linux**.
1. Connect to the new database using the following psql command:

1. You can select one of the following options to install the EDB Postgres Advanced Server:
```SQL
\connect <database_name>
```

- Repository
- More options
1. Import the required SQL files into the new database using the following psql command:

1. For information on the installation procedure, select **EDB Postgres Advanced Server Installation Guide** for Linux.
```SQL
\i <path_to_exported_schema_file>.sql
```

1. To download the assessed schemas, select **Download SQL file**.

1. Extract the downloaded zip file. The zip package consists of SQL files with DDLs for your selected schemas and objects. The DDLs are grouped in SQL files by project, schemas, or objects.

| SQL file naming convention | Description | Example |
|------------------------------------------------|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| *&lt;ProjectName>* _ALL_OBJECTS.sql | A single consolidated file consisting of DDLs for all your selected schemas and objects. | **AllTestMigration_ALL_OBJECTS.sql** will consist of DDLs for all objects of schemas OE, SH, IX, and PM, and only selected objects of schema HR. |
| *&lt;SchemaName>* .sql | One or more files, each consisting of DDLs for selected objects in a particular schema. | **HR.sql** will consist of DDLs for all the selected objects of the HR schema. |
| *&lt;SchemaName>* &#95; *&lt;ObjectType>* .sql | One or more files, each consisting of DDLs for a single selected object. | **HR_TABLE.sql** will consist of DDLs only for TABLE object of the HR schema. |

1. To import the schemas, run:

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

!!! Note
You can alternatively use the `pgAdmin` client for the import.
!!! Note
You can alternatively use the `pgAdmin` client for the import.

The converted schemas migrate to the target server.

## Migrate to the cloud

Migrate schemas on EDB Postgres Advanced Server to the cloud.

1. Select **EDB Postgres Advanced Server on Cloud**.
1. Select **EDB Postgres Advanced Server on Cloud**.

1. Select one or more schemas to migrate to EDB Postgres Advanced Server. You can also expand a schema and select specific object types under each schema.
1. Select one or more schemas to migrate to EDB Postgres Advanced Server. You can also expand a schema and select specific object types under each schema.

![Schema and objects are selected](../images/schema_object_selection.png)

1. Select the cloud platform, for example, **BigAnimal**.
1. Select the cloud platform, for example, **BigAnimal**.

1. To launch a new cluster, select **Go to BigAnimal**.
1. To launch a new cluster, select **Go to BigAnimal**.

Or, if you have an existing cluster running, select **Next**.

!!! Note
See the [Big Animal](https://www.enterprisedb.com/edb-cloud) page for more information.
See the [BigAnimal](https://www.enterprisedb.com/edb-cloud) page for more information.

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

![Connecting to the cloud cluster](../images/mp_migrate_cloud_connection_updated.png)

1. To verify the connection details, select **Test Connection**.
1. To verify the connection details, select **Test Connection**.

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

1. Once the connection is successful, select **Next**.

1. Once the connection is successful, select **Next**.

The converted schemas migrate to the target server.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Data migration"

title: "Performing a data migration"
navTitle: "Data migration"

legacyRedirectsGenerated:
# This list is generated by a script. If you need add entries, use the `legacyRedirects` key.

0 comments on commit 9370bd1

Please sign in to comment.