The slave trade was abolished by France in February 1794. However, Napoleon reinstated it in May 1802, then finally abolished it permanently in March 1815. Despite Napoleon's abolition, a clandestine slave trade continued at Gorée until 1848, when it was abolished throughout all French territories. To replace trade in slaves, the French promoted peanut cultivation on the mainland. As the peanut trade boomed, tiny Gorée Island, whose population had grown to 6,000 residents, proved ineffectual as a port. Traders from Gorée decided to move to the mainland and a "factory" with warehouses was established in Rufisque in 1840.