Here’s how you may be able to separate after-tax dollars from pre-tax dollars in an IRA.

If your traditional IRA holds both pre-tax and after-tax money, you have to treat any distribution from that account, including a conversion, as coming from both categories proportionately. If you have more than one traditional IRA, we use the overall total of pre-tax and after-tax dollars, not the figures from any one IRA, to calculate the ratio.
Example: Your traditional IRA is worth $25,000, and you’ve made $5,000 in after-tax contributions. If you convert $5,000 to a Roth, you can’t treat the entire amount as coming from after-tax dollars. Instead, you’ll have to treat $4,000 as taxable income, because 80% of the IRA is pre-tax money. The same would be true if you held the after-tax money in a separate traditional IRA and you converted only that IRA, because you have to treat all traditional IRAs as a single IRA in figuring the tax consequences of a distribution or conversion.
These rules can stand in the way of a backdoor Roth IRA contribution strategy (contributing to a traditional IRA in anticipation of a conversion, when the income limitation prevents you from contributing directly to a Roth), or simply prevent you from extracting the after-tax money from your traditional IRA for a tax-free Roth conversion.
A possible solution

Since 2002, employer plans have been permitted to accept rollovers from traditional IRAs, provided that the amount rolled over doesn’t exceed the amount that would be taxable if you withdrew all the money from the IRA. You have to report this rollover on your tax return, but you don’t pay tax on any income until you take withdrawals from the employer plan. When you roll all the taxable money from the traditional IRA to an employer plan, the amount remaining in the traditional IRA is equal to its basis. That means you can convert the traditional IRA to a Roth without reporting any income.
There are a number of considerations in using this approach. You have to keep in mind that all your traditional IRAs are treated as a single IRA for purposes of determining the taxable and nontaxable portion. That means you can’t use this approach to eliminate the taxable portion of one traditional IRA while retaining another traditional IRA that holds taxable money.
You also have to keep in mind that this rollover has other consequences. The investment opportunities in the employer plan may or may not be as good as the ones you had available in your IRA. What’s more, you may not be able to demand a distribution from an employer plan whenever you want, the way you can with an IRA.
Employer may balk
Perhaps the most important problem in using this strategy is that although the law permits employers to accept this kind of rollover, it doesn’t require them to do so. Many employers feel these rollovers pose potential problems for their retirement plans and refuse to accept them.
Some people have solved this problem by setting up their own 401k plans. You can’t do this if your only source of income is wages from your employer. If you have your own business, though, you may wish to consider whether this opportunity is valuable enough to justify the cost in time and money of establishing and maintaining your own 401k plan.
Many investment firms now offer a way to start “solo 401k” plans. Be sure to choose one that’s designed to accept rollovers from IRAs. Plan on keeping the 401k running for a period of time, because the IRS doesn’t have to recognize the validity of employer plans that are intended to have only transitory existence.
One more point
The literal language of the law seems to require you to withdraw all your money from the IRA, then roll the pre-tax dollars to the employer plan and roll the after-tax dollars back to an IRA. Congress surely intended to permit you to roll the pre-tax dollars to a 401k while simply leaving the after-tax dollars behind in the IRA. Fortunately the IRS takes this more practical approach in Publication 590-A (2016 ed. p. 21):
Ordinarily, when you have basis in your IRAs, any distribution is considered to include both nontaxable and taxable amounts. Without a special rule, the nontaxable portion of such a distribution could not be rolled over. However, a special rule treats a distribution you roll over into an eligible retirement plan as including only otherwise taxable amounts if the amount you either leave in your IRAs or do not roll over is at least equal to your basis. The effect of this special rule is to make the amount in your traditional IRAs that you can roll over to an eligible retirement plan as large as possible.