Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve how the plugin handles being migrated from server to server #230

Open
jonathanstegall opened this issue Jan 29, 2019 · 5 comments
Open
Labels
enhancement New feature or request question This is not necessarily an issue but it is a question

Comments

@jonathanstegall
Copy link
Member

jonathanstegall commented Jan 29, 2019

Is your feature request related to a problem? Please describe.
When I download a production database and try to run it locally, I always forget that I need to re-authenticate the plugin. This is required because otherwise it will (presumably) still be connected to the production Salesforce instead of the sandbox. This could cause problems.

Describe the solution you'd like
I'm not sure. WordPress has so many different ways of handling development environments that it's possible we can't really even do anything about this. It would be nice though.

@jonathanstegall jonathanstegall added enhancement New feature or request question This is not necessarily an issue but it is a question labels Jan 29, 2019
@ddoddsr
Copy link
Contributor

ddoddsr commented Aug 5, 2019

One simple use case:
One part of my Process is to copy Production to a staging area via WPEngine's tools.
I use that staging as my last test point before putting something on production.
I use a partial Sandbox on the Salesforce Side of that staging

So I would use a set of staging credentials that I can set in production once and click "on" in staging after a copy.

Also to prevent some production activities from happening on test like sending emails when testing, we will identify the database in use and if it is != the production name we assume that we are testing. We do this in wp-config.php right after the define for the DBNAME

@jonathanstegall
Copy link
Member Author

@ddoddsr yeah, we do a similar thing with our setup. That is, we have files with the various credentials in our different environments. That part works pretty well.

The problem I've run into is like this:

  1. I sync production down to stage (for example)
  2. The credentials are correct on stage - that is, they point toward the sandbox I want
  3. However, the other values that are saved when Salesforce performs an authentication are not reset. That is, they still say the production Salesforce instance instead of the sandbox.

So what I tend to do next is go and disconnect from Salesforce on stage, and then reconnect it again (I don't do this very often, since it's not that often that stage needs to deal with the sandbox). But that is annoying. It'd be nice if the plugin could somehow tell that it was running in a different environment than the one it was originally authenticated with, and do those things on its own.

@jonathanstegall
Copy link
Member Author

This is at least related to #322.

@jonathanstegall
Copy link
Member Author

jonathanstegall commented Jan 6, 2020

I think we could handle this the way WooCommerce Subscriptions handles it. They talk about it here. https://docs.woocommerce.com/document/subscriptions-handles-staging-sites/

Developer Note: WooCommerce Subscriptions stores an obscured clone of WordPress’ siteurl value in an option with the name wc_subscriptions_siteurl. It compares this value with the siteurl value to see if it has changed.

jonathanstegall added a commit that referenced this issue Feb 11, 2021
…and unauthorize the plugin if it doesn't match where it's currently running. need to test this more.
@jonathanstegall
Copy link
Member Author

current state is like this: b775d11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question This is not necessarily an issue but it is a question
Projects
None yet
Development

No branches or pull requests

2 participants