Download WordPress VIP database to local install

First, download what you need via VaultPress and then merge the files with the following command in the terminal. (It helps to name filename.sql to the database name you are going to import to).

cd Downloads/unzipped-folder/sql
cat *.sql > filename.sql

If you don’t want to overwrite the current database, comment out the previous one and create a new one in wp-config.php:

# define( 'DB_NAME', 'databasename' );
# define( 'DB_NAME', 'databasename_preprod' );
define( 'DB_NAME', 'databasename_2023-03-19' );

Place the file you downloaded in the WordPress root folder (where wp-config.php is, i.e. ‘above’ the wp-content folder etc.).

(If you are using Local for your local site environment, you may need to access the terminal via the menu option in there, rather than the regular Terminal app, for the following commands to work).

If you want to overwrite an existing database you will need to drop it first. With wp-cli installed, run the following command from the WordPress root folder:

wp db drop

Then:

wp db create
wp db import
wp search-replace livesite.com localsite.test

Or for preprod sites:

wp search-replace www-preprod-url-vip.net localsite.test

Leave a Reply

Your email address will not be published. Required fields are marked *