Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: SQL export #7

Open
jvdh opened this issue Sep 15, 2021 · 2 comments
Open

Feature request: SQL export #7

jvdh opened this issue Sep 15, 2021 · 2 comments

Comments

@jvdh
Copy link

jvdh commented Sep 15, 2021

For backup purposes I'd like to be able to export the database of a project,

@mikeybinns
Copy link

+1 and I would like to add a couple things:

local-cli db export Exports the database to an sql file at a default location (possibly also set a destination as an argument.) (command syntax similar to WP-CLI)
local-cli db import database.sql Imports the database from an sql file export. (command syntax similar to WP-CLI)
local-cli db snapshot-save Save the database state to a fixed location, possibly give it an ID for multiple snapshots.
local-cli db snapshot-restore Restore the database state to the most recent snapshot, or to the snapshot ID if provided.

The snapshot feature would be great for automatic tests, as you could easily save a state before running your tests, then restore it back after the tests have run, without needing any kind of manual input.

@alexclst
Copy link

alexclst commented Jun 1, 2022

I'm not sure what all this would add that the WP-CLI doesn't have already (wp db ...). Since there are ways to access the WP-CLI from the host shell (see #5 for some discussion), using that for functionality it provides is probably best. Now, grant you, the snapshot feature may still be worth looking at, as it isn't quite a direct duplicate of WP-CLI, and since Local already has its own backing up of the database at site stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants