Question: Is there any difference between *there was an increase of 2%* and “there was an increase by 2%”?

Answer: 
The former sounds better to me. The preposition "by" would be more appropriate if you had used "increase" as a verb instead of a noun. (i.e., "It increased by 2%" as opposed to "There was an increase of 2%.")
"Increase" is being used as a verb in the phrase "increase by 2%". This makes the second sentence incorrect (because it already has the verb "is").

"Increase" is being used as a noun in the phrase "increase of 2%", and this makes sense because it is being used as a direct object in the first sentence.