Without any information on what type of database we're talking about here, it'll be near impossible to give you actual advice.
If it's a custom database, you'll have to follow the same route that official importers do, and provide a hashing handler for passwords that match your hashing algorithm.