initial config import implementation with duplicate and cycle detection.