vpoola88
vpoola88

Reputation: 3999

Grabbing mysql dump file from remote server

Im working as an intern and am new to rails and it's production evn. I was wondering how I could grab a database dump from a remote server and import into my local database so that my local env mirrors that of the live version of a site. I have access to the database, and I have the current version of the code in my environment. I am missing the pictures and files attached to the site, and need it to make changes locally.

Upvotes: 3

Views: 3087

Answers (1)

usha
usha

Reputation: 29349

  1. In the production server execute the following command

    mysqldump -u username -ppassword db_name > production_dump.sql

  2. scp the production_dump.sql file to your local machine

  3. In your local machine execute the following command.

    mysql -u username -ppassword db_name < production_dump.sql

Upvotes: 7

Related Questions