vip import sql
Import SQL to your database from a file
Usage
vip import-sql [options] [command]
Options
Option | Description |
---|---|
-a , --app |
Target an application. Accepts a string value for the application name or an integer for the application ID. |
-d , --debug |
Generate verbose output during command execution to help identify or fix errors or bugs. |
-e , --env |
Target an environment. Accepts a string value for the environment type. |
-h , --help |
Retrieve a description, examples, and available options for a (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 |
Retrieve the version number of VIP-CLI currently installed on the local machine. |
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
Name | Description |
---|---|
status |
Check the status of the current running import |
Last updated: July 11, 2024