Cookies ahead

Our support chat tool "Intercom" would like to collect some more data on you. See the related link for more details.

Docs

Database down via terminal

Published

Updated

Reviewedbyfl

Export a remote database and download it to your local development environment via the command line.

Get ready

Do

# Terminal window 1
ssh -N -L 13306:mysql:3306 {{app-env-id}}@ssh.{{region}}.frbit.app
# This has no output. Open a new terminal window next.
shell
# Terminal window 2
# 01. Create a dump from the remote database
mysqldump --set-gtid-purged=OFF --no-tablespaces -h127.0.0.1 -P13306 -u{{app-env-id}} -p {{app-env-id}} > fortrabbit-backup.sql

# 02. Import to your local database
mysql -u{{local-db-user}} -p {{local-db-name}} < fortrabbit-backup.sql
shell

Other development environments

Steps may differ on containerized development environments. You may need to log in to a container or execute a command on the container first.

  • Docker
    • docker exec -i {container} … - execute a command
  • DDEV
    • ddev import-db < dump.sql - import a database from host
    • ddev auth - login to the container (first)
    • ddev exec … - execute a command

Written by a human. Review, grammar checks and typo fixes by AI.

AI use & editorial processEdit on GitHub ↗