Table Of Contents
When this plugin is activated, a new WP-CLI command will be available called go-live
. You may use this command using standard practices such as:
Command usage may be found using a typical wp help go-live
command.
Commands
go-live update
To update the entire database, simply run wp go-live update <old> <new>
replacing <old>
and <new>
with your site’s specific urls such as:
You will see a console response similar to:
Options
- <old> – required
- The old URL to replace in the database.
- <new> – required
- The new URL to replace the old URL.
- –tables – optional
- Limits replacements to database tables matching a provided CSV list of table names.
- Example
--tables=wp_posts,wp_users
. - By default, all tables will be updated.
- Not to be used in conjunction with –sections.
- –sections – optional
- Limits replacements to tables included within a provided CSV list of sections.
- Sections represent what you see in the Go Live settings page sections.
- Available sections include:
- comments
- custom
- network
- options
- posts
- terms
- user
- Example
--sections=posts,user
. - By default, all sections will be updated.
- Not to be used in conjunction with –tables.
- –format – optional
- Format to display updated or found counts by individual tables or sections.
- If not provided, individual table or section counts will not be displayed.
- Available formats include:
- table
- json
- csv
- yaml
- Example
--format=table
. - Counts will be displayed by section unless –tables is provided.
- –dry-run – optional
- Counts the urls without updating them.
- Example
--dry-run
. - Use –format to display counts by individual tables or sections.
Examples
Update the entire database.
Update a provided list of tables.
Update a provided list of sections.
Count the urls without updating the database.
go-live list-sections
Retrieves a list of available sections. Useful for determining which sections may be passed to the update command via –sections.
You will see a console response similar to:
Options
- –format – optional
- Displays the list of sections in a particular format.
- Available formats include:
- list
- csv
- table
- Defaults to csv.
Examples
Display sections as a table.
Display sections as a list.
go-live list-tables
Lists all available database tables. Useful for determining which tables may be passed to the update command via –tables.
You will see a console response similar to:
Options
- –format – optional
- Displays the list of sections in a particular format.
- Available formats include:
- list
- csv
- table
- Defaults to csv.
Examples
Display tables as a table.
Display tables as a list.
go-live test
Runs URL tests and displays the results. This is useful for checking potential issues with a URL migration before actually performing the updates.
You will see a console response similar to:
Options
- <old> – required
- The old URL to test.
- <new> – required
- The new URL to test.
- –format – optional
- Output format for test results.
- Available formats include:
- table (default)
- json
- csv
- yaml
- Example
--format=json
.
Examples
Run tests and display results in a table (default).
Run tests and output as JSON.
go-live history
Lists the last 10 URL update history items. Shows information about previous URL updates including the old URL, new URL, date, and the number of URLs updated.
You will see a console response similar to:
Options
- –format – optional
- Output format for history items.
- Available formats include:
- table (default)
- json
- csv
- yaml
- Example
--format=json
.
- –with-counts – optional
- Display full counts data instead of sum.
- If provided without a value, defaults to “sections”.
- Available options:
- sections – Displays counts combined by sections, similar to the UI.
- tables – Displays counts by individual database tables.
- Example
--with-counts=tables
.
Examples
List history items with default format (table).
Output history as JSON.
Show history with counts by sections.
Show history with counts by tables.