We mainly discuss about how to migrate local self-created PostgreSQL to JCS for PostgreSQL of JD Cloud. Instead of performing daily operation and maintenance, monitoring, backup and other operations by yourself in the case of using self-created local PostgreSQL, you can only concern use by using JCS for PostgreSQL of JD Cloud.
pg_dump -U User Name -h Database Address -p Database Port Database Name -f /Path/Exported File Name.sql Parameter Description User name: User name of self-built database. Database address: Refer to database host name, and localhost can be used for login of local database host. Database port: Refer to the port number of a self-built database. Database name: Fill in a database name to be exported.
Virtual Machines can be created after local self-created PostgreSQL data are exported to local.
Create VM instances, and for specific creation steps, please refer to Create VM Instance. Please attach importance to the following points when creating VM instances
After completion of VM instance creation, it can upload the data file of local to the Virtual Machines by executing the command
scp /Path/Outputted file name.sql User name of Virtual Machines@Virtual Machines public IP: /Virtual Machines path Parameter Description User name of Virtual Machines: User name at the time of creating a virtual machine instance. Virtual Machines EIP: EIP address associated with Virtual Machines. Virtual Machines path: Storage path in Virtual Machines of files uploaded locally.
psql -U User Name -h Cloud Database Domain -d Cloud Database Name -p Cloud Database Port -f /Path of Virtual Machines/Name of Exported File.sql Parameter Description User name: User name in actions of step 2. Cloud Database Domain: The domain of JCS for PostgreSQL can be viewed on the Instance Details Page. Cloud Database Name: Refer to the name of the target database where data are imported. Cloud Database Port: The port number of JCS for PostgreSQL can be viewed on the Instance Details Page.