Skip to content

Updating domain name values

If a database file for import contains domain name values that do not match the VIP Platform destination site’s domain name, a --search-replace operation must be done before or during import.

  • The domain name value for an unlaunched VIP Platform environment is typically a convenience domain (e.g.
  • Search and replace values are separated by a comma only. There are no spaces between the values.

VIP-CLI command examples

For demonstration purposes, the <app-alias> value mytestsite and the <env> value production are used in the VIP-CLI command examples below. Read more about how to target environments in VIP-CLI commands.

Pass the  --search-replace option with the VIP-CLI command vip import sql.

In this command example, the domain http://localhost is replaced during the import process with the convenience domain of the unlaunched destination VIP environment:

vip @mytestsite.production import sql /Users/example-user/file.sql --search-replace="http://localhost,"

Updating multiple domain name values

When importing a database file to a WordPress multisite environment, a --search-replace operation should be included for each network site that is included in the SQL database file.

In this example command, a --search-replace operation is included to replace the domains of 3 network sites in the database file (,, to those of the destination environment (,,

vip @mytestsite.production import sql /Users/example-user/file.sql --search-replace="," --search-replace="," --search-replace=","
  • The order in which the search-replace commands are run can make a difference in the outcome. If --search-replace="," is run before --search-replace=",", the result will be a site with the domain, a site with the domain, and no site with the domain
  • It may be necessary to run additional search-replace operations using WP-CLI commands after the import is complete. To accurately run a search-replace operation, the command structure will depend on whether the search-replace is targeting an entire single site, multisite, or specific tables.

Updating domain name values prior to import

Domain name replacements can be made in the SQL database file prior to import. This can be useful to allow the results of the search and replace operation(s) to be verified prior to importing the file to a VIP Platform environment

To update domain name values in a file located on a local machine, pass the  --in-place option with the VIP-CLI command vip search-replace.

In this example, the domain value is replaced with in the local file file.sql:

vip search-replace /Users/example-user/file.sql --search-replace="," --in-place

Last updated: August 31, 2023

Relevant to

  • WordPress