npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tryghost/mg-stripe

v0.2.19

Published

Migrate Stripe products, prices, coupons, subscriptions and invoices from an old to a new Stripe account.

Downloads

343

Readme

Migrate Stripe

Migrate Stripe products, prices, coupons, subscriptions and invoices from an old to a new Stripe account.

Install

Install the migrate CLI @tryghost/migrate as a global package:

npm install --global @tryghost/migrate

To use this package in your own project:

npm install @tryghost/mg-stripe --save

or

yarn add @tryghost/mg-stripe

Usage

Pre-requisites

Before proceeding, be sure to have:

  1. Disabled new subscriptions on the old site
  2. Copied all Stripe customers, using the Stripe dashboard (docs)

Copy

The copy command makes a copy of products, prices, coupons, invoices and subscriptions from the old to the new Stripe account. It will also pause existing subscriptions in the old Stripe account.

migrate stripe copy

We recommend running a dry run first, with the option --dry-run. The dry run will not create any data in the new Stripe account, nor update any data in the old Stripe account.

migrate stripe copy --dry-run

Some other useful options are:

  • --from: the Stripe API secret key of the old account (optional)
  • --to: the Stripe API secret key of the new account (optional)
  • --delay: Period (in hours, starting now) during which payment collection is paused. This period should be large enough to cover the entire migration. Estimated time to migrate 10,000 members is 1 hour, we recommend adding an extra hour of buffer time to be safe (optional)
  • --subscription: Only migrate a specific subscription id (optional). The value should be the subscription ID, i.e. sub_1234abcd5678efgh1234abcd
  • --subscriptions-csv: Path to a CSV file containing subscription IDs to migrate (optional). The CSV must have a subscription_id column header. Cannot be used with --subscription

Here's an example of the CSV that should be passed to subscriptions-csv.

subscription_id,customer_email
sub_1234abcd5678efgh,[email protected]
sub_2345bcde6789fghi,[email protected]
sub_3456cdef7890ghij,[email protected]
sub_4567defg8901hijk,[email protected]

See full list of options here.

Confirm

The command command confirms a previously created copy. It will finalise subscriptions and invoices in the new Stripe account.

migrate stripe confirm

Revert

The revert command reverts the copy. It will delete any data created in the new Stripe account and resume subscriptions in the old Stripe account.

migrate stripe revert

Develop

This is a mono repository, managed with lerna. Follow the instructions for the top-level repo.

Install

  1. cd to the top of the monorepo
  2. Run yarn to install dependencies.

Run

  1. cd to the top of the monorepo
  2. Run yarn dev:watch (compiles TypeScript files)
  3. Run yarn dev stripe <command> to run the copy, confirm or revert command

Test

  • yarn lint to run linting
  • yarn test to run unit tests

To run E2E tests, you need a test Stripe API-key. Create a .env file and store it in this folder (packages/mg-stripe):

STRIPE_API_KEY=sk_test_xxx

After that you can run the E2E tests via yarn test:e2e.

To easily filter and write new E2E tests you can run it like yarn test:e2e same-account to only run E2E tests that match a file name.

Copyright & License

Copyright (c) 2013-2026 Ghost Foundation - Released under the MIT license.