vip import sql
Import a SQL database file to an environment.
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 |
Perform a search and replace operation on a local SQL file, save the results to the file, then import the updated file. |
-o , --output |
Create a local copy of the imported file with the completed search and replace operations. Ignored if the command includes –in-place, or excludes a –search-replace operation. Accepts a local file path. |
-S , --search-replace |
Search for a string in the SQL file and replace it with a new string. Separate the values by a comma only; no spaces (e.g. –search-replace=“from,to”). |
-s , --skip-validate |
Do not perform file validation prior to import. If the file contains unsupported entries, the import is likely to fail. |
-v , --version |
Retrieve the version number of VIP-CLI currently installed on the local machine. |
Examples
- Import the local SQL database backup file "file.sql" to the develop environment of the "example-app" application.
$ vip @example-app.develop import sql file.sql
- Perform a search and replace operation on the SQL database file during the import process.
$ vip @example-app.develop import sql file.sql --search-replace="https://from.example.com,https://to.example.com"
- Perform multiple search and replace operations on the SQL database file during the import process.
$ vip @example-app.develop import sql file.sql --search-replace="from.example.com,to.example.com" --search-replace="example.com/from,example.com/to"
- Perform a search and replace operation on "file.sql" locally, save the changes, then import the updated file.
$ vip @example-app.develop import sql file.sql --search-replace="https://from.example.com,https://to.example.com" --in-place
- Create a copy of the imported file with the completed search and replace operations and save it locally to a file named "updated-file.sql".
$ vip @example-app.develop import sql file.sql --search-replace="https://from.example.com,https://to.example.com" --output="updated-file.sql"
- Check the status of the most recent SQL database import to the develop environment of the "example-app" application. * This will continue to poll until the import is complete.
$ vip @example-app.develop import sql status
Subcommands
Name | Description |
---|---|
status |
Check the status of a SQL database import currently in progress. |
Last updated: November 18, 2024