Migrating stripe data to new Stripe Account

I had an experience of migrate one of my company stripe account data(customers, subscriptions, payments) into another company stripe account(diffrent country).

So, I thought doing this will be super easy, just change country name into Stripe account and that's all. But that's not Stripe allow you to do that.

Stripe just Copy existing account data to a new Stripe account excect individual charges, invoices, plans and subscriptions, coupons, events, and logs do not copy over.

You can read this on Stripe official website Copy existing account data

Stripe just copy raw data of customers only into your new Stripe accounts. So, I recreate the customers subscription into new Stripe account with some JavaScript code.

Here I'm going to share the way I took into this process.

1st step — Request stripe customer service to copy customers data from old Stripe account to new Stripe account and this will took maxiumum 2 days.

Now you will have customers raw data with same customer id as in old account, customers payment method, & some more meta data.

Now the coding part will start here, I use nodejs for this automation.

Create Products

First I created products into new Stripe account from old one.

The above code is getting products data from old stripe account and create into new one. You can do manually, if you have not many products.

Subscribe

Now we are going to migrate customers subscription data into new account.

The above code is getting all the subscription data from old stripe account, and then we make a for loop to create subscription. So, we create subscription with trial ends param.

So, the tricky part is the customer from old stripe account will be on trial into new stripe account. So, when the trial expired customer subscription will start.

Note: I write this code for stripe data migration in my case.

This is all, I can share now. If you found usefule then let me know on twitter @mddanishyusuf

Thanks