Exclude tables on import
gathering interest
Kevin Hoffman
gathering interest
While the original question was about excluding users, I think it makes sense to broaden the feature request to exclude any table when importing. Historically we have recommended configuring a database export to include only the tables that are intended to be imported at the destination. However, there may be cases where excluding at the time of import is preferred.
Kevin Hoffman
John Weiss Yes, but you will want to exclude user tables from the original export. If you are using WP Migrate Lite to export the database, then you can deselect the
wp_users
and wp_usermeta
table to exclude them from the export. If you are importing that same database with WP Migrate Pro, then the user tables will be left untouched because they were not included in the export. Only the tables that are included in the imported database get overwritten.John Weiss
Kevin Hoffman: awesomeness. Thx for that!.
What if I restore the backup to a staging site, then backup that staging, and then restore it to the live site. Must again exclude the users tables from the staging backup?
Can I achieve staging with Lite?
Kevin Hoffman
John Weiss: It depends how you are performing the import. WP Migrate Lite can export the database for free, however you would need to manually perform the import. With WP Migrate Pro, you can export and import the database, or push and pull directly between two sites. For a staging setup where you are frequently syncing two environments, I would highly recommend a Plus license or better so you can push and pull changes on a regular basis with saved migration profiles.
We recommend a workflow where "code goes up and content comes down" in order to avoid database conflicts where you may otherwise overwrite users in your production environment by accident. With a Plus license, you can set up a pull migration profile that can be used to pull the database from production to staging as needed.