Kyle Ross

Kyle Ross

Digital Technology Consultant in Prescott, AZ πŸ‡ΊπŸ‡Έ

Get in Touch

How to Sync Your WordPress Database from InstaWP to Local App

October 17, 2025

A complete guide to pulling your WordPress database from InstaWP cloud hosting to your local development environment using WP-CLI and Local by Flywheel.

Tools Required

  • Local by Flywheel - Local WordPress development environment
  • WP-CLI - WordPress command-line interface (included with Local and InstaWP)
  • SSH/SCP - For connecting to and transferring files from InstaWP
  • MySQL - Database management (included with Local)
  • Terminal/Command Line - macOS Terminal, Windows PowerShell, or similar

Prerequisites

Before you begin, ensure you have:

  • An active InstaWP site with SSH access enabled
  • Local by Flywheel installed on your computer
  • A local WordPress site created in Local
  • Your InstaWP SSH credentials (host, username, password, port)

Step 1: Get Your InstaWP SSH Credentials

  1. Log into your InstaWP dashboard at https://app.instawp.io
  2. Navigate to your site
  3. Look for the "Connect" or "SSH/SFTP" section
  4. Note down the following:
    • Host/IP: yoursite.instawp.site
    • Port: 22
    • Username: your-username
    • Password: Your SSH password

Step 2: Connect to InstaWP via SSH

Open your terminal and connect to InstaWP:

ssh your-username@yoursite.instawp.site -p 22

Enter your password when prompted.

Note: You may see some warnings about bash history or channel errors - these are harmless and can be ignored.

Step 3: Locate Your WordPress Installation

Once connected, find where WordPress is installed:

# Search for wp-config.php
find /home -name "wp-config.php" 2>/dev/null

This will output something like:

/home/your-username/web/yoursite.instawp.site/public_html/wp-config.php

Navigate to that directory:

cd /home/your-username/web/yoursite.instawp.site/public_html/

Verify you're in the right place:

ls -la

You should see WordPress files: wp-admin, wp-content, wp-includes, wp-config.php

Step 4: Export the Database from InstaWP

# Export the database
wp db export instawp-backup.sql

You should see:

Success: Exported to 'instawp-backup.sql'.

Step 5: Download the Database to Your Computer

Open a NEW terminal window on your local computer (keep the SSH session open).

Download the SQL file using SCP:

scp -P 22 your-username@yoursite.instawp.site:/home/your-username/web/yoursite.instawp.site/public_html/instawp-backup.sql ~/Downloads/

Enter your password when prompted. The file will download to your Downloads folder.

Step 6: Open Local Site Shell

  1. Open Local by Flywheel
  2. Find your local development site in the list
  3. Right-click on the site name
  4. Select "Open Site Shell"

This opens a terminal that's pre-configured for your Local site.

Step 7: Verify WP-CLI is Working

In the Local Site Shell:

wp --info

You should see WP-CLI version information (ignore any PHP warnings).

Step 8: Backup Your Current Local Database

Always backup before importing!

wp db export backup-before-import.sql

Step 9: Clean the SQL File (MariaDB Compatibility)

InstaWP uses MariaDB, which has a slightly different SQL format. Clean the file:

# Remove the first line (MariaDB-specific)
tail -n +2 ~/Downloads/instawp-backup.sql > ~/Downloads/instawp-backup-clean.sql

Verify the cleaned file looks correct:

head -n 5 ~/Downloads/instawp-backup-clean.sql

Should show:

-- MariaDB dump 10.19...
--
-- Host: localhost    Database: ...

Step 10: Check InstaWP's Table Prefix

# Look at the table names in the SQL file
head -n 50 ~/Downloads/instawp-backup-clean.sql | grep "Table structure"

Note the prefix (e.g., iwpfe4a_, wp_, etc.). You'll need this for the next step.

Step 11: Update Your Local wp-config.php

Your local site needs to use the same table prefix as InstaWP.

# Open wp-config.php in your default editor
open ~/Local\ Sites/yoursite/app/public/wp-config.php

Find this line:

$table_prefix = 'wp_';

Change it to match InstaWP's prefix:

$table_prefix = 'iwpfe4a_';  // Use the prefix you found in Step 10

Save and close the file.

Step 12: Get Your Local Database Name

wp config get DB_NAME

This will output your database name (usually local or something similar).

Step 13: Import the Database

Reset your database and import the InstaWP data:

# Drop all existing tables
wp db reset --yes

# Import using MySQL directly (more reliable than wp db import)
mysql -u root your-database-name < ~/Downloads/instawp-backup-clean.sql

Note: Replace your-database-name with the name from Step 12.

If prompted for a password, try root or just press Enter.

Step 14: Verify the Import

wp db tables

You should now see tables with InstaWP's prefix (e.g., iwpfe4a_posts, iwpfe4a_options, etc.).

Step 15: Search-Replace URLs (CRITICAL!)

This replaces all hardcoded URLs in your database.

Dry run first (see what will change):

wp search-replace 'https://yoursite.instawp.site' 'http://yoursite.local' --all-tables --dry-run

Replace with your actual URLs:

  • https://yoursite.instawp.site = Your InstaWP production URL
  • http://yoursite.local = Your Local development URL

Step 16: Clear Cache and Flush Permalinks

wp cache flush
wp rewrite flush

Step 17: Test Your Site

In Local app, click "Open Site" or visit your local URL in a browser.

Your InstaWP site should now be running locally!

Troubleshooting

"ERROR 1064: SQL syntax error"

If you get this error with wp db import, use MySQL directly:

mysql -u root your-database-name < ~/Downloads/instawp-backup-clean.sql

"Table prefix doesn't match"

Make sure you updated wp-config.php with the correct $table_prefix from InstaWP's database.

PHP Extension Warnings

If you see warnings about opcache.so, imagick.so, or xdebug, you can safely ignore them. They don't affect WP-CLI functionality.

To remove them permanently:

# Open Local's PHP config
open "/Users/your-username/Library/Application Support/Local/run/XXXXXXX/conf/php/php.ini"

Comment out these lines by adding ; at the start:

;extension=imagick.so
;extension=opcache.so
;zend_extension=xdebug.so

Save and restart your site in Local.

Site Still Shows InstaWP URLs

Make sure you ran the wp search-replace command in Step 15. You can run it again if needed.

Can't Find wp-config.php on InstaWP

InstaWP paths vary. Try:

cd ~
find . -name "wp-config.php" 2>/dev/null

Future Syncs - Quick Reference

Once you've done this once, future syncs are faster:

# 1. ON INSTAWP (via SSH)
cd /home/your-username/web/yoursite.instawp.site/public_html/
wp db export instawp-backup.sql

# 2. ON YOUR COMPUTER (download)
scp -P 22 your-username@yoursite.instawp.site:/home/your-username/web/yoursite.instawp.site/public_html/instawp-backup.sql ~/Downloads/

# 3. IN LOCAL SITE SHELL
tail -n +2 ~/Downloads/instawp-backup.sql > ~/Downloads/instawp-backup-clean.sql
wp db reset --yes
mysql -u root local < ~/Downloads/instawp-backup-clean.sql
wp search-replace 'https://yoursite.instawp.site' 'http://yoursite.local' --all-tables
wp cache flush && wp rewrite flush

Automation Option

For frequent syncs, consider creating a bash script based on this tutorial that automates the entire process.

Summary

You've successfully:

  • βœ… Connected to InstaWP via SSH
  • βœ… Exported the production database
  • βœ… Downloaded it to your local machine
  • βœ… Imported it into Local app
  • βœ… Updated all URLs with search-replace
  • βœ… Set up your local development environment with production data

Your local site now mirrors your InstaWP production site, and you can develop with real data!

Additional Resources

Back to Articles