MySql

Comando di export

mysqldump --max_allowed_packet=1G --host=localhost --user=root -p --add-locks=TRUE --port=3306 --default-character-set=utf8 --comments --single-transaction=TRUE --routines -p "isharedoc_production" > /tmp/isharedoc_production.sql

Comando di import

mysql -u admin -e "create database isharedoc_production_clone default charset utf8"

mysql -u admin isharedoc_production_clone -p < /tmp/isharedoc_production.sql

Verifica dimensione database

SELECT table_schema "isharedoc_production", SUM( data_length + index_length) / 1024 / 1024 / 1024 "Data Base Size in GB" FROM information_schema.TABLES GROUP BY table_schema;

 

PostgreSQL

Comando di export

pg_dump --host localhost --port 5432 --username "admin" --no-password --format custom --blobs --verbose --file "/tmp/isharedoc_production.dump" "isharedoc_production"

Comando di import

createdb --host localhost --port 5432 --username "admin" --no-password "isharedoc_production_clone" --owner "admin"
pg_restore --host localhost --port 5432 --username "admin" --dbname "isharedoc_production_clone" --no-password  --verbose "/tmp/isharedoc_production.dump"