WordPress & WooCommerce: Localhost, Staging and production environments and how to sync them without losing data

I recommend to work with fixtures on localhost and development environments.

Fixtures definition from Symfony documentation:

Fixtures are used to load a “fake” set of data into a database that
can then be used for testing or to help give you some interesting data
while you’re developing your application.

To work with fixtures on WordPress you can use wp-cli and wp import command to import WXR files. Of course you can keep WXR files in repository to provide data for other developers. Using fixtures you are providing consistent data to all developers and testing environment.

For staging environment I would recommend to replicate production database.

I don’t know if you plan to update database schema as your app will grow. WordPress is so elastic that in my 95% cases I don’t need to update schema. If you think you have such a case get familiar with database migrations. Basically migrations are scripts which know if database schema need to be updated, will update it and optionally can do rollback if something goes wrong during deploy.