I went to use wp db import the other day, but was a little unsure of how it worked. If you can answer the following questions I'll update the docs on it:
wp-config.php, or should the database already be created?AFAIK, database should already exist for db import. And it should be as per DB_NAME in wp-config.php.
It does not empty database. It just executes queries those are in the sql file.
@ernilambar is correct. It doesn't create the database, and it only performs whatever tasks are defined in your sql file. If your sql file has queries to empty the database (or drop tables), then it would empty the database. Or, if your sql file just has INSERT queries, then it will just insert new data into the database.
@danielbachhuber May be we can close this now.
Most helpful comment
@ernilambar is correct. It doesn't create the database, and it only performs whatever tasks are defined in your
sqlfile. If yoursqlfile has queries to empty the database (or drop tables), then it would empty the database. Or, if yoursqlfile just hasINSERTqueries, then it will just insert new data into the database.