Skip to content
GravityKit
Buy
Sign in
0 items
  • Plugins

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Forms—everything you need to build powerful web apps and workflows.

    Learn more
    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, PDF, or Google Sheets, then share them with secure links or deliver them to cloud storage on a schedule.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data between sites, including forms, entries, settings, Views, feeds, and file uploads, and import forms from other form plugins.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    • GravitySearch

      GravitySearch

      Search Gravity Forms entries across every form from one screen.

  • Ideal For

    • Nonprofits
    • Web Agencies
    • Education
    • Developers
    • Small Businesses
    • Startups
    Explore All Use Cases

    Case studies

    • Be There Local
    • Killer Shorts
    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    View All Case Studies
  • Resources

    • Blog
    • Case studies
    • Newsletter
    • GravityKit vs competitors
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy

    Ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Support
  • Pricing
  • Plugins

    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, PDF, or Google Sheets, then share them with secure links or deliver them to cloud storage on a schedule.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data between sites, including forms, entries, settings, Views, feeds, and file uploads, and import forms from other form plugins.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    • GravitySearch

      GravitySearch

      Search Gravity Forms entries across every form from one screen.

    View All Products

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Forms—everything you need to build powerful web apps and workflows.

    Learn more
  • Ideal For

    • Nonprofits
    • Web Agencies
    • Education
    • Developers
    • Small Businesses
    • Startups
    Explore All Use Cases

    Case studies

    • Be There Local
    • Killer Shorts
    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    View All Case Studies

    How to build...

    • Client Portal
    • AI-Built Directory
    • Conference Website
    • WordPress CRM
    • Admin Dashboard
    • Inventory Management
    • Vendor Portal
    • Document Library
    View All Guides
  • Resources

    • Blog
    • Case studies
    • Newsletter
    • GravityKit vs competitors
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy

    ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Support
  • Pricing
0 items

Search

Results appear automatically as you type.
Loading results…

results found matching

    Sign in
    Buy

    Docs

    • Docs Home

    Gravity Forms Add-Ons

    • GravityView
    • GravityActions
    • GravityBoard
    • GravityCalendar
    • GravityCharts
    • GravityEdit
    • GravityExport
    • GravityImport
    • GravityMath
    • GravityRevisions
    • GravitySearch
    • GF Widget for Elementor
    • GF Dynamic Lookup
    • GF Entry Tags
    • GF Event Field
    • GravityExport Lite
    • GF Zero Spam
    • GravityMigrate

    GravityView

    • Getting Started
    • View Setup
    • FAQ
    • Pre-Sale
    • Advanced
    • Common Problems
    • Customizing Your Views
    • Edit Entry
    • Entry Approval
    • Filter and Sort Results
    • Gravity Forms
    • Merge Tags
    • Roles and Capabilities
    • Search
    • Shortcodes
    • View Settings
    • WordPress Posts

    General Help

    • Account, Invoices, and Billing
    • License Related
    • Plugins and Settings
    • Agency accounts
    • Contact
    • Docs Home
    • Gravity Forms Add-Ons

      • GravityView
      • GravityActions
      • GravityBoard
      • GravityCalendar
      • GravityCharts
      • GravityEdit
      • GravityExport
      • GravityImport
      • GravityMath
      • GravityRevisions
      • GravitySearch
      • GF Widget for Elementor
      • GF Dynamic Lookup
      • GF Entry Tags
      • GF Event Field
      • GravityExport Lite
      • GF Zero Spam
      • GravityMigrate
    • GravityView

      • Getting Started
      • View Setup
      • FAQ
      • Pre-Sale
      • Advanced
      • Common Problems
      • Customizing Your Views
      • Edit Entry
      • Entry Approval
      • Filter and Sort Results
      • Gravity Forms
      • Merge Tags
      • Roles and Capabilities
      • Search
      • Shortcodes
      • View Settings
      • WordPress Posts
    • General Help

      • Account, Invoices, and Billing
      • License Related
      • Plugins and Settings
      • Agency accounts
    • Contact

    GravityMigrate

    • Migrating a large site
    • Migrating between Contact Form 7 and Gravity Forms
    • Migrating between Fluent Forms and Gravity Forms
    • Migrating between Formidable Forms and Gravity Forms
    • Migrating between Forminator and Gravity Forms
    • Migrating between Ninja Forms and Gravity Forms
    • Migrating between WPForms and Gravity Forms
    • Migrating between WS Form and Gravity Forms
    • Migrating forms from another form plugin
    • Migrating forms with AI using the GravityKit MCP
    • Migrating Gravity Forms from the command line with WP-CLI
    • What changes when you import
    • Where uploaded files go during a migration
    • Which feeds and add-ons migrate
    • Which fields migrate between Gravity Forms and each form plugin
    • Best practices to follow when moving data using GravityMigrate
    • Getting started with GravityMigrate
    • GravityMigrate hooks
    • How does GravityMigrate handle nested forms?
    • Migrating Zapier feeds
    • Home
    • Docs
    • GravityMigrate
    • Migrating Gravity Forms from the command line with WP-CLI

    Migrating Gravity Forms from the command line with WP-CLI

    Estimated reading: 10 minutes

    Updated on September 10, 2026

    GravityMigrate includes WP-CLI commands for exporting and importing your Gravity Forms and GravityKit data from the command line. Every command uses the wp gk migrate prefix. This is useful for scripted migrations, moving data between servers over SSH, and migrating sites that are too large to export through the browser.

    Note: The command line is an alternative to the GravityMigrate screen in wp-admin, not a replacement. Both produce and read the same export bundle, so you can export in the browser and import on the command line, or the reverse.

    Before you begin #

    • WP-CLI installed on the server you run the commands on.
    • GravityMigrate active on both the source and destination sites. GravityKit Foundation, bundled with the plugin, registers the wp gk commands.
    • An administrator account. The export, import, and reset commands read and write your data, so they require one: pass --user=<administrator login>. Without it, the command stops and asks for an administrator.

    Quick start #

    The most common workflow is to export a bundle on one site and import it on another:

    # On the source site: export everything to a ZIP
    wp gk migrate export --user=admin --forms=all --data=all --output=/tmp/migration.zip
    
    # Copy the ZIP to the destination site (scp, rsync, etc.), then import it
    wp gk migrate import /tmp/migration.zip --user=admin --yes

    Exporting a bundle #

    wp gk migrate export writes the forms and data you choose to a portable ZIP bundle.

    # Export specific forms with their entries, Views, and pages
    wp gk migrate export --user=admin --forms=3,5 --data=entries,views,posts --output=/srv/backups/forms.zip
    
    # Export every form and every data type
    wp gk migrate export --user=admin --forms=all --data=all --output=/srv/backups/all.zip
    
    # Only entries created within a date range
    wp gk migrate export --user=admin --forms=all --data=entries --date-start=2026-01-01 --date-end=2026-06-30 --output=/tmp/first-half.zip
    
    # Encrypt the ZIP with a password
    wp gk migrate export --user=admin --forms=all --data=all --password="a-strong-password" --output=/tmp/secure.zip
    
    # Package the uploaded files inside the ZIP
    wp gk migrate export --user=admin --forms=all --data=all --include-files --output=/tmp/standalone.zip

    Flag

    What it does

    --forms=<ids>

    Comma-separated form IDs, or all.

    --data=<types>

    Comma-separated data types, or all. Defaults to entries,views,posts. See Data types below.

    --date-start=<Y-m-d>, --date-end=<Y-m-d>

    Limit exported entries to a date range.

    --password=<password>

    Encrypt the ZIP (AES-256).

    --include-files

    Package the uploaded files inside the ZIP, so the importing site does not download them from this one. Use it when this site is not reachable from the destination or is about to be switched off. The ZIP gets much larger, and files past the site’s own upload limit are left out and still downloaded on import.

    --public-url=<url>

    Rewrite this site’s address to <url> in exported file-upload links, so uploads download on import when the source’s own address is not reachable from the destination.

    --output=<path>

    Copy the finished ZIP to this path. Without it, the ZIP stays in the exports directory and is removed after three hours.

    --porcelain

    Output only the ZIP path.

    Tip: Use --public-url when the source site’s stored address is not reachable from the destination, for example a local or staging clone. Entry file uploads are downloaded from the addresses stored in the bundle, so they must resolve from the importing server.


    Importing a bundle #

    wp gk migrate import reads a bundle and writes its forms, entries, Views, and other data into the current site. Import into a clean destination when you can, so results do not stack.

    # Import everything in a bundle, skipping the confirmation prompt
    wp gk migrate import /tmp/migration.zip --user=admin --yes
    
    # Import only certain forms or data types from the bundle
    wp gk migrate import /tmp/migration.zip --user=admin --forms=3,5 --data=entries,views --yes
    
    # Import a password-protected bundle
    wp gk migrate import /tmp/secure.zip --user=admin --password="a-strong-password" --yes
    
    # Import without downloading entry file uploads
    wp gk migrate import /tmp/migration.zip --user=admin --skip-uploads --yes

    Flag

    What it does

    <zip>

    Path to the bundle. The first argument, required.

    --forms=<ids>

    Form IDs to import, or all (default). Each must exist in the bundle.

    --data=<types>

    Data types to import, or all (default), intersected with what the bundle contains.

    --password=<password>

    Password, if the bundle is encrypted.

    --skip-uploads

    Do not download entry file uploads.

    --yes

    Skip the confirmation prompt.

    --porcelain

    Output only the newly created form IDs, one per line.

    --download-timeout=<secs>, --max-download-bytes=<n>, --max-dump-file-size=<n>

    Per-run overrides for the import safety limits.

    Note: Importing writes into your Gravity Forms tables. Back up the destination site first, and prefer a clean destination so imported entries and Views are not mixed with existing data.


    Inspecting a bundle before importing #

    wp gk migrate inspect shows what a bundle contains without importing it: its forms, data types, source address, and whether its uploads will download from this server.

    wp gk migrate inspect /tmp/migration.zip
    
    # As JSON
    wp gk migrate inspect /tmp/migration.zip --format=json

    Checking migration state #

    wp gk migrate status reports whether an import is in progress, whether a previous import stalled, and whether an export left state behind to clean up. Since GravityMigrate 1.4.0 it also reports a running import’s progress: the current phase, how much has been processed, percent complete, and an estimated time remaining. Add --watch to keep it running and follow the import until it finishes.

    wp gk migrate status
    wp gk migrate status --format=json
    
    # Follow a running import until it finishes (GravityMigrate 1.4.0+)
    wp gk migrate status --watch

    Clearing stuck migration state #

    If an import was interrupted and a later one is refused, wp gk migrate reset clears the stuck state: the temporary tables, the extracted files, and the progress locks.

    wp gk migrate reset --user=admin --yes

    Migrating forms to or from another form plugin #

    The same migration the wizard runs between Gravity Forms and another form plugin on the site is available on the command line. Gravity Forms stays the hub: to copies Gravity Forms forms into another plugin, and from recreates another plugin’s forms as Gravity Forms forms. Both run one form at a time, with the same permission checks as the screen. Migrating forms from another form plugin explains what moves and how to read the report.

    First list the plugins this site can migrate to or from:

    wp gk migrate plugins
    wp gk migrate plugins --available --format=ids

    The listing names each plugin’s slug, whether it can be a destination (to), whether it can be a source (from), and the reason when a direction is unavailable. Copy Gravity Forms forms into another plugin:

    # See what would happen to each field, and change nothing
    wp gk migrate to contact-form-7 --forms=all --dry-run
    
    # Recreate forms 3 and 5 in Ninja Forms
    wp gk migrate to ninja-forms --forms=3,5 --user=admin --yes
    
    # Recreate every active form in WPForms and print the IDs it created
    wp gk migrate to wpforms --forms=all --user=admin --yes --format=ids

    Bring another plugin’s forms into Gravity Forms:

    # See what would happen to each field, and change nothing
    wp gk migrate from ninja-forms --forms=all --dry-run
    
    # Recreate Contact Form 7's form 2 as a Gravity Forms form
    wp gk migrate from contact-form-7 --forms=2 --user=admin --yes

    Flag

    What it does

    <plugin>

    The other plugin’s slug, as wp gk migrate plugins lists it.

    --forms=<ids>

    Comma-separated form IDs, or all. For to, the IDs are Gravity Forms form IDs and all means every active, untrashed form. For from, the IDs are the other plugin’s own form IDs and all means every form that plugin lists.

    --dry-run

    Print the report of what happens to each field and change nothing.

    --yes

    Skip the confirmation prompt. Required with any --format other than table.

    --format=<format>

    table (default), json, count or ids. count and ids describe the forms that were created; a form that failed is in neither. json carries every form, including its failure.

    Warnings the migration produces are printed as it runs.


    Data types #

    The --data flag accepts a comma-separated list of these types, or all:

    Type

    What it includes

    entries

    Form entries with their metadata and notes.

    uploads

    Entry file uploads. Downloaded from the source during import, so it requires entries.

    views

    GravityView Views.

    posts

    The pages that embed your Views, and other connected posts.

    revisions

    Form revision history.

    addon_feeds

    Add-on feeds, for example GravityView and GravityCharts.

    gravityflow

    Gravity Flow workflow activity, where present.

    drafts

    Saved and continued draft submissions.

    gf_settings

    Gravity Forms settings.

    gk_settings

    GravityKit settings.

    rest_api_keys

    Gravity Forms REST API keys.


    Output formats #

    Commands that print data support --format=table (the default, human-readable) and --format=json (machine-readable). For scripting, wp gk migrate export --porcelain prints only the ZIP path, and wp gk migrate import --porcelain prints only the newly created form IDs.


    Scripting a migration between two servers #

    Because --porcelain prints only the essential value, you can chain export and import over SSH:

    #!/bin/bash
    set -e
    
    # Export on the source site and capture just the ZIP path
    ZIP=$(wp gk migrate export --user=admin --forms=all --data=all --porcelain)
    
    # Copy it to the destination and import it there
    scp "$ZIP" deploy@destination:/tmp/migration.zip
    ssh deploy@destination "wp gk migrate import /tmp/migration.zip --user=admin --yes --porcelain"

    Troubleshooting #

    “‘gk’ is not a registered wp command”: Make sure GravityMigrate is active. The commands are registered through GravityKit Foundation, which is bundled with every GravityKit plugin.

    “Run with –user=<an administrator login>”: The export, import, and reset commands require an administrator. Add --user= with an administrator’s username or ID.

    “Import already in progress”: A previous import did not finish. Run wp gk migrate status to confirm, then wp gk migrate reset --user=admin --yes, and try the import again.

    Entry file uploads did not download: The source site’s address is not reachable from the destination. Re-export with --public-url= set to an address that resolves from the importing server, or re-export with --include-files so the files travel inside the ZIP.

    The bundle’s database dump is too large: Raise the limit for a single run with --max-dump-file-size=<bytes> on the import command.


    Related articles #

    • Getting started with GravityMigrate
    • Migrating forms from another form plugin
    • Best practices for moving data using GravityMigrate
    • GravityMigrate hooks
    • Firewall or WAF blocking GravityKit imports and exports
    • Getting started with GravityMigrate
    • Migrating forms from another form plugin
    • Best practices for moving data using GravityMigrate
    • GravityMigrate hooks
    • Firewall or WAF blocking GravityKit imports and exports
    Still stuck? How can we help?

    How can we help?

    "*" indicates required fields

    This field is for validation purposes and should be left unchanged.
    Replies will go to this email.
    How can we help?*
    My pre-sale question is related to...*
    My WordPress skills are....*
    My Gravity Forms skills are...*
    You will be shown articles from our documentation.
    Vous pouvez nous écrire dans votre langue maternelle si c’est plus facile pour vous—nous nous occuperons de la traduction!
    Puedes escribirnos en tu idioma nativo si te resulta más fácil; ¡nosotros nos encargamos de la traducción!
    Sie können uns in Ihrer Muttersprache schreiben, wenn das für Sie einfacher ist – wir kümmern uns um die Übersetzung!
    U kunt ons in uw moedertaal schrijven als dat gemakkelijker voor u is — wij zorgen voor de vertaling!
    Du kan skrive til oss på ditt morsmål hvis det er enklere for deg — vi tar oss av oversettelsen!
    Du kan skriva till oss på ditt modersmål om det är lättare för dig — vi tar hand om översättningen!
    Você pode nos escrever em seu idioma nativo se for mais fácil para você — nós cuidaremos da tradução!
    Puoi scriverci nella tua lingua madre se ti è più facile — penseremo noi alla traduzione!
    Please provide as much detail as you're able; this helps us provide you with faster support.
    Drop files here or
    Accepted file types: jpg, jpeg, gif, png, tiff, pdf, bmp, zip, json, csv, xls, xlsx, Max. file size: 256 MB.
      Get better at Gravity Forms every Friday

      Was this page helpful?

      Table Of Contents
      • Before you begin
      • Quick start
      • Exporting a bundle
      • Importing a bundle
      • Inspecting a bundle before importing
      • Checking migration state
      • Clearing stuck migration state
      • Migrating forms to or from another form plugin
      • Data types
      • Output formats
      • Scripting a migration between two servers
      • Troubleshooting
      • Related articles
      GravityKit
      • How to Build It
      • GravityKit vs competitors
      • Pricing
      • Products
      • Our Team
      • Our Values
      • Work With Us
      • Partner Directory
      • Coupons
      Support
      • Support
      • Contact
      • Documentation
      • Scope of Support
      • Brand Guidelines
      • Privacy Policy
      • Terms of Service (“Terms”)
      I am a...
      • Nonprofit
      • Web agency
      • Small business owner
      • Web developer
      • Educational institution
      • WordPress freelancer
      • Startup founder
      • One-person agency
      Get notified of updates.

      We’re constantly improving GravityKit. Fill out your email below and we’ll notify you anytime major updates drop.

      See past editions
      • Facebook
      • Twitter
      • Mastodon
      GravityKit is a Gravity Forms Certified Developer.

      Copyright © 2026, Katz Web Services, Inc.

      GravityKit and GravityView are registered trademarks of Katz Web Services, Inc.

      Live demos, product updates, real answers

      A free live session and Q&A on Tuesday, October 20 at 11am ET / 5pm CET

      Register Now