Migration of PostgreSQL databases to Managed Databases for 1C
You can migrate data from your PostgreSQL database to Managed Databases by Selectel using a logical dump.
Before migration, create a destination database cluster; the versions of the destination and source clusters must match.
Logical dump
Create a database dump (a file containing restoration commands) in the source cluster and restore the dump in the destination cluster.
You can create an SQL dump of all databases (names, tables, indexes, and foreign keys will be preserved) or a custom format dump (for example, you can restore only the schema or the data of a specific table).
SQL dump
-
Create a database dump in the source cluster using the pg_dump utility:
pg_dump \-h <host> \-U <user_name> \-d <database_name> \-f dump.sqlSpecify:
<host>— the IP address or DNS name of the source cluster master host;<user_name>— the user name;<database_name>— the database name.
-
Restore the dump in the destination cluster using the psql utility:
psql \-f dump.sql \-h <host> \-p 5432 \-U <user_name> \-d <database_name>Specify:
<host>— the IP address or DNS name of the destination cluster master host;<user_name>— the database user name;<database_name>— the database name.
Custom format dump
A database copy in custom format is compressed by default.
-
Create a database dump in the source cluster using the pg_dump utility:
pg_dump \-Fc -v \-h <host> \-U <user_name> \<database_name> > archive.dumpSpecify:
<host>— the IP address or DNS name of the source cluster master host;<user_name>— the database user name;<database_name>— the database name.
-
Restore the dump in the destination cluster using the pg_restore utility:
pg_restore \-v \-h <host> \-U <user_name> \-d <database_name> archive.dumpSpecify:
<host>— the IP address or DNS name of the destination cluster master host;<user_name>— the database user name;<database_name>— the database name.