SQL Export

Lando ships with a helper db-export script that is available in all our LAMP and LEMP based recipes. Used in the recipe context it should export a database dump DATABASE.TIMESTAMP.gz into the /app directory.

You can also export databases from other services.

Prefer video tutorials?

Usage

At the command line execute:

lando db-export

Examples

# Export to a file named `DATABASE.TIMESTAMP.gz`
lando db-export

# Export to a file called dump.sql.gz
lando db-export dump.sql

# Export from a secondary database
lando db-export --host db2

# Dump the result to stdout
lando db-export --stdout

Options

Options:
  --host, -h      The database service to use                  [default: "database"]
  --stdout        Dump database to stdout

Adding the db-export command

If you are not using one of our LAMPy recipes you can add the db-export command and default options to the 'tooling' section of your Landofile.

tooling:
  'db-export [file]':
    service: :host
    description: Exports database from a database service to a file
    cmd: /helpers/sql-export.sh
    user: root
    options:
      host:
        description: The database service to use
        default: database
        alias:
          - h
      stdout:
        description: Dump database to stdout

Additional Reading

Guides and Tutorials

Advanced Usage

Known Issues

Troubleshooting

results matching ""

    No results matching ""