This is a simple Python package which you can use to convert a LAMMPS data file to a LAMMPS molecule file.
python data2mol.py
You will be prompted for the "style" (only full and molecular are available, for now) and the path of the data file you want to convert. Please refer to the LAMMPS Documentation for further details on these formats and molecule styles.