目录
文档用途
Highgo Database数据库单机迁移
详细信息
1. 备份数据库,并传输目标机器
cp -rp data data.bak180102
[root@localhost 4.1_2]# ls -l | grep data
drwx------ 20 highgo highgo 4096 1月 3 17:16 data
drwx------ 19 highgo highgo 4096 12月 21 00:05 data.bak1
drwx------ 20 highgo highgo 4096 1月 2 20:18 data.bak180102
2. 创建数据库
highgo=# drop database test_qy;
DROP DATABASE
highgo=# create database test_qy;
CREATE DATABASE
3. 导出数据库
[highgo@localhost ~]$ pg_dump -p 5866 -U highgo -F c -b -v -f test_qy.backup test_qy
pg_dump: last built-in OID is 16383
pg_dump: reading extensions
pg_dump: identifying extension members
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: reading user-defined functions
pg_dump: reading user-defined types
pg_dump: reading procedural languages
……
4. 传输数据库备份
[root@localhost highgo]# scp -rp test_qy.backup 10.254.23.240:/hgdata
The authenticity of host '10.254.23.240 (10.254.23.240)' can't be established.
ECDSA key fingerprint is 77:13:18:d7:2d:a1:8d:bc:33:b0:d1:ce:84:d6:2e:fd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.254.23.240' (ECDSA) to the list of known hosts.
[email protected]'s password:
test_qy.backup 100% 2891MB 99.7MB/s 00:29
详细恢复数据库方案请登录【瀚高技术支持平台】查看
https://support.highgo.com/#/index/docContent/befca44202d102f0