MySQL
You can backup your MySQL data by using the mysqldump command. This command connects to the MySQL server and creates an SQL dump file. The dump file contains the SQL statements necessary to re-create the database.
Backup:
Restore:
Postgres Database backup and Restore to dump file
Here is the quick snippet of how backup and restore postgres database
Backup:
"pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
|
Restore:
"pg_restore --verbose --host #{host} --username #{user} --clean --no-owner --no-acl --dbname #{db} #{Rails.root}/db/#{app}.dump”
|
Postgres Database backup and Restore to sql file
Backup:
$ pg_dump -U {user-name} {source_db} -f {dumpfilename.sql}
|
Restore:
psql -U {user-name} -d {desintation_db}-f {dumpfilename.sql}
|
No comments:
Post a Comment