Skip to content

vip import sql

Import SQL to your database from a file

Usage

vip import-sql [options] [command]

Options

OptionDescription
-a, --app Specify the app
-d, --debug Activate debug output
-e, --env Specify the environment
-h, --help Output the help for the (sub)command
-i, --in-place Search and Replace explicitly on the given input file
-o, --output [value] Specify the replacement output file for Search and Replace (defaults to “process.stdout”)
-S, --search-replace Search for a given URL in the SQL file and replace it with another. The format for the value is `,` (e.g. –search-replace=”https://from.com,https://to.com”
-s, --skip-validate Do not perform pre-upload file validation. If unsupported entries are present, the import is likely to fail
-v, --version Output the version number

Examples

- Import the given SQL file to your site
$ vip import sql @mysite.develop file.sql

- Perform a Search and Replace, then import the replaced file to your site. * Ensure there are no spaces between your search-replace parameters
$ vip import sql @mysite.develop file.sql --search-replace="https://from.example.com,https://to.example.com"

- Perform multiple search and replace tasks, then import the updated file to your site.
$ vip import sql @mysite.develop file.sql --search-replace="https://from.example.com,https://to.example.com" --search-replace="example.com/from,example.com/to"

- Search and Replace on the input `file.sql`, then import the updated file to your site
$ vip import sql @mysite.develop file.sql --search-replace="https://from.example.com,https://to.example.com" --in-place

- Output the performed Search and Replace to the specified output file, then import the replaced file to your site * Has no effect when the `in-place` flag is used
$ vip import sql @mysite.develop file.sql --search-replace="https://from.example.com,https://to.example.com" --output="output.sql"

- Check the status of the most recent import. If an import is running, this will poll until it is complete.
$ vip import sql status @mysite.develop

Subcommands

NameDescription
status Check the status of the current running import

Last updated: February 08, 2024