# How to convert contents of a 'thebibliography' environment into a bib file?

In my Latex document, I have the bibliography included in the text as:

\begin{thebibliography}{99}
\bibitem{item1} citation1
\bibitem{item2} citation2
.
.
.
\end{thebibliography}


I want to specify this bibliography as a .bib file. My attempt is I copy past the:

\bibitem{item1} citation1
\bibitem{item2} citation2
.
.
.


in a .tex file; for the next step, I want to convert it to a .bib file. How can I do that?