Suppose a charity organisation has built 40 or so custom Drupal 6 modules as part of a system to run certain aspects of their business. Suppose that now they want to de-brand it and sell it to similar organisations.
The original poster was asking what version of Drupal to use -- polish up the Drupal 6 version, port to Drupal 7, or go all the way to Drupal 8? But the discussion quickly turned to the logistics and licensing issues around selling a Drupal-based product at all.
The thing is, the way Drupal is licensed, you cannot restrict what other people do with anything you create on top of Drupal, once you provide it to them. So while you can sell your modules, you can't prevent your customers from giving them away after they've purchased them -- if you try to restrict them, you actually lose the right to use Drupal itself, under the terms of the GPL license.
So the question becomes, how do you build a business around a custom solution built on Drupal? You have a few options:
- Charge for services. This is what most Drupal shops do -- charge for development, maintenance, training, support, hosting, and more. Not for the code.
- Get funded to develop the module in the first place -- aside from traditional pay-by-the hour models, crowdfunding has risen as a great way to spread the cost of development across a bunch of interested customers. Grants can be another source of development. These funding models fit very well with the open source model that Drupal uses.
- Software as a Service. Nothing says you have to sell or give your custom modules away in the first place -- you can operate a business on top of Drupal without giving away any of your "secret sauce."
You can attempt to do what the original poster wanted, publish the modules and make them available for sale. The challenge here is that once you've sold to one person, you can't restrict them further.