diff --git a/English/SUMMARY.md b/English/SUMMARY.md index fb2db472..299f8160 100644 --- a/English/SUMMARY.md +++ b/English/SUMMARY.md @@ -776,7 +776,7 @@ * [Create and Manage PostgreSQL Cluster](vdb/relational-database-service-rds/postgresql/create-and-manage-postgresql-cluster.md) * [PostgreSQL Cluster Parameters](vdb/relational-database-service-rds/postgresql/postgresql-cluster-parameters.md) * [vDB PostgreSQL - Supported Extensions](vdb/relational-database-service-rds/postgresql/vdb-postgresql-cac-extension-duoc-ho-tro.md) - * [Migrate from Postgres Single to Postgres Cluster](vdb/relational-database-service-rds/postgresql/migrate-from-postgres-single-to-cluster.md) + * [Migrate from PostgreSQL Single to PostgreSQL Cluster](vdb/relational-database-service-rds/postgresql/migrate-from-postgresql-single-to-cluster.md) * [MemoryStore Database Service (MDS)](vdb/memorystore-database-service-mds/README.md) * [Redis Standalone](vdb/memorystore-database-service-mds/redis-standalone/README.md) * [Create MDS Instance](vdb/memorystore-database-service-mds/khoi-tao-mds-instance.md) diff --git a/English/vdb/relational-database-service-rds/postgresql/migrate-from-postgres-single-to-cluster.md b/English/vdb/relational-database-service-rds/postgresql/migrate-from-postgresql-single-to-cluster.md similarity index 79% rename from English/vdb/relational-database-service-rds/postgresql/migrate-from-postgres-single-to-cluster.md rename to English/vdb/relational-database-service-rds/postgresql/migrate-from-postgresql-single-to-cluster.md index 51a22fab..bac64d30 100644 --- a/English/vdb/relational-database-service-rds/postgresql/migrate-from-postgres-single-to-cluster.md +++ b/English/vdb/relational-database-service-rds/postgresql/migrate-from-postgresql-single-to-cluster.md @@ -1,9 +1,9 @@ -# Migrate from Postgres Single to Postgres Cluster +# Migrate from PostgreSQL Single to PostgreSQL Cluster -This guide walks you through exporting data from a **Postgres Single Node** instance and restoring it to a **Postgres Cluster** on vDB. Two scenarios are covered: **Section A** for instances with a single database, and **Section B** for instances with multiple databases. +This guide walks you through exporting data from a **PostgreSQL Single Node** instance and restoring it to a **PostgreSQL Cluster** on vDB. Two scenarios are covered: **Section A** for instances with a single database, and **Section B** for instances with multiple databases. {% hint style="info" %} -**Note:** vDB does not support changing the Deployment Type of an existing database. Migration requires creating a new Postgres Cluster and transferring data manually using the steps below. +**Note:** vDB does not support changing the Deployment Type of an existing database. Migration requires creating a new PostgreSQL Cluster and transferring data manually using the steps below. {% endhint %} *** @@ -13,24 +13,24 @@ This guide walks you through exporting data from a **Postgres Single Node** inst Before you begin, make sure: * `psql`, `pg_dump` or `pg_dumpall`, and `pg_restore` are installed on the machine running the migration (version must match the PostgreSQL version on the source instance). -* You have credentials (host, username, password) for both the Postgres Single Node and the Postgres Cluster. +* You have credentials (host, username, password) for both the PostgreSQL Single Node and the PostgreSQL Cluster. *** ## A. Single-Database Migration (pg\_dump) -Use this section when your Postgres Single Node instance contains **one database** that you want to migrate. +Use this section when your PostgreSQL Single Node instance contains **one database** that you want to migrate. ### Step 1 — Verify Connectivity -Before starting, confirm that both your Postgres Single Node instance and your Postgres Cluster are running and reachable. +Before starting, confirm that both your PostgreSQL Single Node instance and your PostgreSQL Cluster are running and reachable. ```bash -# Test Postgres Single Node +# Test PostgreSQL Single Node psql -h -U -d -c "SELECT 1;" -# Test Postgres Cluster +# Test PostgreSQL Cluster psql -h -U -d -c "SELECT 1;" ``` @@ -81,7 +81,7 @@ The custom format (`-Fc`) produces a compressed binary file and supports multi-j *** -### Step 4 — Restore on Postgres Cluster +### Step 4 — Restore on PostgreSQL Cluster Restore the dump to the target cluster using the method that matches your export format. @@ -101,7 +101,7 @@ psql -h -U -d \ {% hint style="warning" %} **Superuser errors during restore:** -Postgres Cluster does not grant superuser access. You may see errors such as `ERROR: must be superuser` or warnings about `ALTER TABLE ... OWNER TO`. These are expected and safe to ignore. +PostgreSQL Cluster does not grant superuser access. You may see errors such as `ERROR: must be superuser` or warnings about `ALTER TABLE ... OWNER TO`. These are expected and safe to ignore. The flags `--no-owner` and `--no-privileges` (shown above for `pg_restore`) suppress the most common ones. Any error related to table creation or actual data should be investigated before proceeding. {% endhint %} @@ -110,7 +110,7 @@ The flags `--no-owner` and `--no-privileges` (shown above for `pg_restore`) supp ### Step 5 — Verify the Restored Data -After the restore completes, validate the data on Postgres Cluster before cutting over traffic. Recommended checks: +After the restore completes, validate the data on PostgreSQL Cluster before cutting over traffic. Recommended checks: * Compare table counts between source and target. * Compare row counts for critical tables. @@ -121,7 +121,7 @@ After the restore completes, validate the data on Postgres Cluster before cuttin ## B. Multi-Database Migration (pg\_dumpall / pg\_dump) -Use this section when your Postgres Single Node instance contains **more than one database**. +Use this section when your PostgreSQL Single Node instance contains **more than one database**. *** @@ -130,10 +130,10 @@ Use this section when your Postgres Single Node instance contains **more than on Confirm that both instances are running and accessible before proceeding. ```bash -# Test Postgres Single Node +# Test PostgreSQL Single Node psql -h -U -c "\l" -# Test Postgres Cluster +# Test PostgreSQL Cluster psql -h -U -c "\l" ``` @@ -186,14 +186,14 @@ pg_dump -h -U -d \ ``` {% hint style="info" %} -`pg_dump` does not export global objects such as roles and tablespaces. You must recreate these manually on Postgres Cluster before restoring. See Step 3 for details. +`pg_dump` does not export global objects such as roles and tablespaces. You must recreate these manually on PostgreSQL Cluster before restoring. See Step 3 for details. {% endhint %} *** ### Step 4 — Recreate Roles and Tablespaces (if needed) -If your databases rely on specific roles or custom tablespaces, recreate them on Postgres Cluster before restoring. Roles created here will need passwords set manually. +If your databases rely on specific roles or custom tablespaces, recreate them on PostgreSQL Cluster before restoring. Roles created here will need passwords set manually. ```sql -- Recreate a role @@ -205,7 +205,7 @@ If you used `pg_dumpall`, the SQL file contains role definitions, but some state *** -### Step 5 — Restore on Postgres Cluster +### Step 5 — Restore on PostgreSQL Cluster **If you used pg\_dumpall (Option A)**, restore with `psql` connecting to the default `postgres` database: @@ -235,7 +235,7 @@ ALTER ROLE WITH PASSWORD ''; ### Step 6 — Verify Each Database -After the restore, verify every database on Postgres Cluster: +After the restore, verify every database on PostgreSQL Cluster: * Confirm all expected databases are present. * Check table counts and row counts in each database. @@ -258,7 +258,7 @@ After the restore, verify every database on Postgres Cluster: **`ERROR: must be superuser`** -Errors mentioning superuser access are expected on both Postgres Single Node and Postgres Cluster. Skip them. Use `--no-owner` and `--no-privileges` flags with `pg_restore` to suppress the most common cases. +Errors mentioning superuser access are expected on both PostgreSQL Single Node and PostgreSQL Cluster. Skip them. Use `--no-owner` and `--no-privileges` flags with `pg_restore` to suppress the most common cases. **Roles or ownership errors after restore** @@ -266,7 +266,7 @@ Errors mentioning superuser access are expected on both Postgres Single Node and **Missing tablespaces** -If the source database uses custom tablespaces, the restore may fail because those tablespaces do not exist on the target cluster. Recreate any required tablespaces on Postgres Cluster before running the restore. +If the source database uses custom tablespaces, the restore may fail because those tablespaces do not exist on the target cluster. Recreate any required tablespaces on PostgreSQL Cluster before running the restore. **Table creation errors** @@ -282,6 +282,6 @@ For very large databases, use `pg_restore --jobs ` to enable multi-job restor After verifying the data successfully: -* Update the connection string in your application to point to the Postgres Cluster (new host, port, and credentials). +* Update the connection string in your application to point to the PostgreSQL Cluster (new host, port, and credentials). * Confirm the application works correctly against the migrated database. -* Delete the old Postgres Single Node on vDB once you have confirmed it is no longer needed. +* Delete the old PostgreSQL Single Node on vDB once you have confirmed it is no longer needed. diff --git a/Vietnamese/SUMMARY.md b/Vietnamese/SUMMARY.md index ab99899e..05ed9c96 100644 --- a/Vietnamese/SUMMARY.md +++ b/Vietnamese/SUMMARY.md @@ -904,7 +904,7 @@ * [Khởi tạo và Quản lý PostgreSQL Cluster](vdb/relational-database-service-rds/postgresql/khoi-tao-va-quan-ly-postgresql-cluster.md) * [Cấu hình tham số cho Cluster](vdb/relational-database-service-rds/postgresql/cau-hinh-tham-so-cho-cluster.md) * [vDB PostgreSQL - Các extension được hỗ trợ](vdb/relational-database-service-rds/postgresql/vdb-postgresql-cac-extension-duoc-ho-tro.md) - * [Migrate từ Postgres Single sang Postgres Cluster](vdb/relational-database-service-rds/postgresql/migrate-tu-postgres-single-sang-cluster.md) + * [Migrate từ PostgreSQL Single sang PostgreSQL Cluster](vdb/relational-database-service-rds/postgresql/migrate-tu-postgresql-single-sang-cluster.md) * [MemoryStore Database Service (MDS)](vdb/memorystore-database-service-mds/README.md) * [Redis Standalone](vdb/memorystore-database-service-mds/redis-standalone/README.md) * [Khởi tạo MDS Instance](vdb/memorystore-database-service-mds/khoi-tao-mds-instance.md) diff --git a/Vietnamese/vdb/relational-database-service-rds/postgresql/migrate-tu-postgres-single-sang-cluster.md b/Vietnamese/vdb/relational-database-service-rds/postgresql/migrate-tu-postgresql-single-sang-cluster.md similarity index 81% rename from Vietnamese/vdb/relational-database-service-rds/postgresql/migrate-tu-postgres-single-sang-cluster.md rename to Vietnamese/vdb/relational-database-service-rds/postgresql/migrate-tu-postgresql-single-sang-cluster.md index 1e11dd05..75b7c487 100644 --- a/Vietnamese/vdb/relational-database-service-rds/postgresql/migrate-tu-postgres-single-sang-cluster.md +++ b/Vietnamese/vdb/relational-database-service-rds/postgresql/migrate-tu-postgresql-single-sang-cluster.md @@ -1,9 +1,9 @@ -# Migrate từ Postgres Single sang Postgres Cluster +# Migrate từ PostgreSQL Single sang PostgreSQL Cluster -Hướng dẫn này mô tả các bước export dữ liệu từ **Postgres Single Node** và restore sang **Postgres Cluster** trên vDB. Tài liệu bao gồm hai tình huống: **Phần A** cho instance có một database, và **Phần B** cho instance có nhiều database. +Hướng dẫn này mô tả các bước export dữ liệu từ **PostgreSQL Single Node** và restore sang **PostgreSQL Cluster** trên vDB. Tài liệu bao gồm hai tình huống: **Phần A** cho instance có một database, và **Phần B** cho instance có nhiều database. {% hint style="info" %} -**Lưu ý:** vDB không hỗ trợ thay đổi Deployment Type của database hiện có. Việc migrate yêu cầu tạo mới một Postgres Cluster và chuyển dữ liệu thủ công theo các bước dưới đây. +**Lưu ý:** vDB không hỗ trợ thay đổi Deployment Type của database hiện có. Việc migrate yêu cầu tạo mới một PostgreSQL Cluster và chuyển dữ liệu thủ công theo các bước dưới đây. {% endhint %} *** @@ -13,24 +13,24 @@ Hướng dẫn này mô tả các bước export dữ liệu từ **Postgres Sin Trước khi bắt đầu, hãy đảm bảo: * `psql`, `pg_dump` hoặc `pg_dumpall`, và `pg_restore` đã được cài đặt trên máy thực hiện migrate (phiên bản khớp với PostgreSQL trên instance nguồn). -* Bạn có credentials (host, username, password) cho cả Postgres Single Node và Postgres Cluster. +* Bạn có credentials (host, username, password) cho cả PostgreSQL Single Node và PostgreSQL Cluster. *** ## A. Migrate một database (pg\_dump) -Sử dụng phần này khi Postgres Single Node của bạn chứa **một database** cần migrate. +Sử dụng phần này khi PostgreSQL Single Node của bạn chứa **một database** cần migrate. ### Bước 1 — Kiểm tra kết nối -Trước khi bắt đầu, hãy xác nhận rằng cả Postgres Single Node và Postgres Cluster đều đang chạy và có thể kết nối được. +Trước khi bắt đầu, hãy xác nhận rằng cả PostgreSQL Single Node và PostgreSQL Cluster đều đang chạy và có thể kết nối được. ```bash -# Kiểm tra Postgres Single Node +# Kiểm tra PostgreSQL Single Node psql -h -U -d -c "SELECT 1;" -# Kiểm tra Postgres Cluster +# Kiểm tra PostgreSQL Cluster psql -h -U -d -c "SELECT 1;" ``` @@ -81,7 +81,7 @@ Custom format (`-Fc`) tạo ra file binary được nén và hỗ trợ restore *** -### Bước 4 — Restore trên Postgres Cluster +### Bước 4 — Restore trên PostgreSQL Cluster Restore dữ liệu lên cluster đích theo đúng định dạng đã export. @@ -101,7 +101,7 @@ psql -h -U -d \ {% hint style="warning" %} **Lỗi superuser trong quá trình restore:** -Postgres Cluster không cấp quyền superuser. Bạn có thể gặp lỗi như `ERROR: must be superuser` hoặc cảnh báo về `ALTER TABLE ... OWNER TO`. Đây là hành vi bình thường và có thể bỏ qua. +PostgreSQL Cluster không cấp quyền superuser. Bạn có thể gặp lỗi như `ERROR: must be superuser` hoặc cảnh báo về `ALTER TABLE ... OWNER TO`. Đây là hành vi bình thường và có thể bỏ qua. Các flag `--no-owner` và `--no-privileges` (dùng với `pg_restore`) sẽ ngăn các lỗi phổ biến nhất. Bất kỳ lỗi nào liên quan đến việc tạo bảng hoặc dữ liệu thực cần được xem xét kỹ trước khi tiếp tục. {% endhint %} @@ -110,7 +110,7 @@ Các flag `--no-owner` và `--no-privileges` (dùng với `pg_restore`) sẽ ng ### Bước 5 — Xác minh dữ liệu sau restore -Sau khi restore hoàn tất, hãy kiểm tra dữ liệu trên Postgres Cluster trước khi chuyển traffic sang. Khuyến nghị một số kiểm tra: +Sau khi restore hoàn tất, hãy kiểm tra dữ liệu trên PostgreSQL Cluster trước khi chuyển traffic sang. Khuyến nghị một số kiểm tra: * So sánh số lượng bảng giữa nguồn và đích. * So sánh số lượng bản ghi trong các bảng quan trọng. @@ -121,7 +121,7 @@ Sau khi restore hoàn tất, hãy kiểm tra dữ liệu trên Postgres Cluster ## B. Migrate nhiều database (pg\_dumpall / pg\_dump) -Sử dụng phần này khi Postgres Single Node của bạn chứa **nhiều hơn một database**. +Sử dụng phần này khi PostgreSQL Single Node của bạn chứa **nhiều hơn một database**. *** @@ -130,10 +130,10 @@ Sử dụng phần này khi Postgres Single Node của bạn chứa **nhiều h Xác nhận cả hai instance đang chạy và có thể kết nối được trước khi tiến hành. ```bash -# Kiểm tra Postgres Single Node +# Kiểm tra PostgreSQL Single Node psql -h -U -c "\l" -# Kiểm tra Postgres Cluster +# Kiểm tra PostgreSQL Cluster psql -h -U -c "\l" ``` @@ -186,14 +186,14 @@ pg_dump -h -U -d \ ``` {% hint style="info" %} -`pg_dump` không export các global object như role và tablespace. Bạn phải tạo lại chúng thủ công trên Postgres Cluster trước khi restore. Xem Bước 3 để biết thêm chi tiết. +`pg_dump` không export các global object như role và tablespace. Bạn phải tạo lại chúng thủ công trên PostgreSQL Cluster trước khi restore. Xem Bước 3 để biết thêm chi tiết. {% endhint %} *** ### Bước 4 — Tạo lại Role và Tablespace (nếu cần) -Nếu database của bạn phụ thuộc vào các role hoặc tablespace cụ thể, hãy tạo lại chúng trên Postgres Cluster trước khi restore. Các role được tạo ở đây cần đặt mật khẩu thủ công. +Nếu database của bạn phụ thuộc vào các role hoặc tablespace cụ thể, hãy tạo lại chúng trên PostgreSQL Cluster trước khi restore. Các role được tạo ở đây cần đặt mật khẩu thủ công. ```sql -- Tạo lại một role @@ -205,7 +205,7 @@ Nếu bạn dùng `pg_dumpall`, file SQL chứa định nghĩa role nhưng một *** -### Bước 5 — Restore trên Postgres Cluster +### Bước 5 — Restore trên PostgreSQL Cluster **Nếu dùng pg\_dumpall (Tùy chọn A)**, restore bằng `psql` kết nối vào database mặc định `postgres`: @@ -235,7 +235,7 @@ ALTER ROLE WITH PASSWORD ''; ### Bước 6 — Xác minh từng database -Sau khi restore, kiểm tra toàn bộ database trên Postgres Cluster. Khuyến nghị một số kiểm tra: +Sau khi restore, kiểm tra toàn bộ database trên PostgreSQL Cluster. Khuyến nghị một số kiểm tra: * Xác nhận tất cả database dự kiến đều hiện diện. * Kiểm tra số lượng bảng và số lượng bản ghi trong từng database. @@ -258,7 +258,7 @@ Sau khi restore, kiểm tra toàn bộ database trên Postgres Cluster. Khuyến **`ERROR: must be superuser`** -Lỗi về quyền superuser là bình thường trên cả Postgres Single Node và Postgres Cluster. Bỏ qua chúng. Dùng flag `--no-owner` và `--no-privileges` với `pg_restore` để ngăn các lỗi phổ biến nhất. +Lỗi về quyền superuser là bình thường trên cả PostgreSQL Single Node và PostgreSQL Cluster. Bỏ qua chúng. Dùng flag `--no-owner` và `--no-privileges` với `pg_restore` để ngăn các lỗi phổ biến nhất. **Lỗi về role hoặc ownership sau khi restore** @@ -266,7 +266,7 @@ Lỗi về quyền superuser là bình thường trên cả Postgres Single Node **Thiếu tablespace** -Nếu database nguồn sử dụng custom tablespace, quá trình restore có thể thất bại vì các tablespace đó không tồn tại trên cluster đích. Tạo lại các tablespace cần thiết trên Postgres Cluster trước khi chạy lệnh restore. +Nếu database nguồn sử dụng custom tablespace, quá trình restore có thể thất bại vì các tablespace đó không tồn tại trên cluster đích. Tạo lại các tablespace cần thiết trên PostgreSQL Cluster trước khi chạy lệnh restore. **Lỗi tạo bảng** @@ -282,6 +282,6 @@ Với database rất lớn, dùng `pg_restore --jobs ` để bật chế đ Sau khi xác minh dữ liệu thành công: -* Cập nhật connection string trong ứng dụng để trỏ sang Postgres Cluster (host, port, credentials mới). +* Cập nhật connection string trong ứng dụng để trỏ sang PostgreSQL Cluster (host, port, credentials mới). * Kiểm tra ứng dụng hoạt động bình thường với database vừa migrate. -* Xóa Postgres Single Node cũ trên vDB sau khi đã xác nhận không còn cần thiết. +* Xóa PostgreSQL Single Node cũ trên vDB sau khi đã xác nhận không còn cần thiết.