pronamic / wp-pronamic-pay

The Pronamic Pay plugin allows you to easily accept payments with payment methods like credit card, iDEAL, Bancontact and Sofort through a variety of payment providers on your WordPress website.
https://pronamicpay.com
35 stars 14 forks source link

Migrating subscriptions #341

Open rvdsteege opened 2 years ago

rvdsteege commented 2 years ago

From customer in a support ticket:

We are currently in the process of launching a new version of *****. Now we currently have a lot of recurring subscriptions/donations in the website. Do you have any instructions on how we should go about and migrate those into our new website?

We now advise to update the theme and leave the database intact — which holds the subscriptions for Pronamic Pay and e-commerce plugin (e.g. Gravity Forms, MemberPress, WooCommerce Subscriptions). But this is not always an option:

Helaas is het voor ons niet mogelijk om met dezelfde database verder te werken. Nu is het voor ons geen probleem om op database niveau zelf wat specifieke data te migreren.

De nieuwe website wordt parallel gebouwd aan de huidige website. Aangezien er tijdens de bouw nieuwe herhaaldelijke betalingen worden afgesloten, kunnen we dit niet overnemen uit een backup. Is er een manier om Pronamic handmatig over te zetten? Wellicht via database oid?

Migrating the pronamic_gateway, pronamic_payment and pronamic_pay_subscr post types and associated post meta will continue the recurring payments for subscriptions in most cases (as the reference to the Mollie customer and mandate is nowadays stored in the subscription post content JSON). However, if the gateway configuration post ID has changed during migration, updating the _pronamic_subscription_config_id meta of the subscriptions to the new configuration post ID is also necessary.

Although the recurring payments are possibly starting fine after manual migration, some references (such as WordPress users, source IDs, etc.) are possibly broken after migration. This might result in loss of functionality (for instance, it is not possible to use the Gravity Forms form subscription notifications anymore if the form entries are not migrated or have changed IDs).

Can we improve the process of migrating subscriptions to a new website? Maybe with a separate import/export add-on plugin? Implementing custom tables in https://github.com/pronamic/wp-pronamic-pay/issues/234 might also help to ease migration.

Internal Help Scout tickets:

remcotolsma commented 2 years ago

Dear Pronamic Pay support employee,

I'm contacting you because of an interesting question regarding the Pronamic Pay plugin. I'm wondering if you've ever done something like I'm describing below before, or have some code examples laying around. That could prevent us from re-inventing the wheel.

We're creating a completely new website for one of our existing customers. In their old website, they have a combination of GravityForms and Pronamic Pay, and the PSP Mollie. That combination is used to create subscriptions in Pronamic Pay.

In the new website we're building, we're switching this up. There we will introduce WooCommerce with WooCommerce Subscriptions. We will keep Pronamic Pay to handle the WooCommerce payments in the website. and we will keep using Mollie as the PSP.

What i'm trying to attempt to do, is migrate the existing subscriptions from the old website, to the new one. I've already been able to create a CSV file containing most of the Pronamic Pay subscription data from the old website. If you're curious to see what I've already exported, see this screenshot: https://prnt.sc/CXVlH8uZMXUO. What I've also been able to do, is creating WooCommerce orders and subscriptions from that CSV file. The next step, and that's where I would like to ask if there is any help available, is to also create corresponding payments and subscriptions in Pronamic Pay. And this in such a way that the subscriptions keep working when we release the new website (and take down the old one).

Do you know if there are some code examples available to got this done?

Thank you in advance!

Kind regards,

Internal Help Scout ticket: https://secure.helpscout.net/conversation/2071791287/24814