If the database is on the internal storage, connect the device to the computer and then transfer the folder named "/Internal Storage/WhatsApp/Database" from the old Android device to the computer. Copy the same folder from the computer to the new Android device and sync the file named "msgstore-XX.db.crypt" to the new Android device.