# Revert "Convert to BibLatex format"

**URL:** <https://discourse.jabref.org/t/revert-convert-to-biblatex-format/699>\
**Category:** Help\
**Created:** [July 18, 2017, 6:14pm UTC](https://discourse.jabref.org/t/revert-convert-to-biblatex-format/699 "2017-07-18T18:14:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pablo](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@pablo](https://discourse.jabref.org/u/pablo)\
**Post date:** [July 18, 2017, 6:14pm UTC](https://discourse.jabref.org/t/revert-convert-to-biblatex-format/699/1 "2017-07-18T18:14:15Z")

</div>

I have made a cleanup of my database with the option “Convert to BibLatex format” checked. Not only the _journal_ key has changed to _journaltitle_ but also _year_ to _date_. The _year_ key is not there anymore, and _date_ does not seem compatible with bibtex.

Is it possible to revert the database format from biblatex to bibtex again?

Thanks

---

<div class="post-metadata">

**Author:** ![matthiasgeiger](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/matthiasgeiger/32/7_2.png) [@matthiasgeiger](https://discourse.jabref.org/u/matthiasgeiger)\
**Post date:** [July 24, 2017, 7:38pm UTC](https://discourse.jabref.org/t/revert-convert-to-biblatex-format/699/2 "2017-07-24T19:38:30Z")

</div>

Hi Pablo,

unfortunately this is not possible (despite just using the “undo” functionality). If you had just the year in the bibtex data without having a month it would be possible to use the function “Quality” -\> “Set/clear/rename fields” to rename the field “date” to “year” - but this does not work if there is a date such as “2005-06”.

In this case only external tools, e.g., text editors with good search and replace functionality based on regular expressions might help to restore the previous state.

Best regards  
Matthias

---

<div class="post-metadata">

**Author:** ![pablo](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@pablo](https://discourse.jabref.org/u/pablo)\
**Post date:** [July 30, 2017, 12:53pm UTC](https://discourse.jabref.org/t/revert-convert-to-biblatex-format/699/3 "2017-07-30T12:53:10Z")

</div>

Thanks for the reply, Matthias. I solved the problem with the following python script.

```
import re
old_db = open("biblatex.bib","r")
new_db = open("bibtex.bib","w")
for line in old_db.readlines():
    date_pattern = re.search("date.*{(\d+)-?(\d+)?}",line)
    if date_pattern:
        new_db.write("year={{{0:s}}},\n".format(date_pattern.group(1)))
        print "year={{{0:s}}},\n".format(date_pattern.group(1)),
        if date_pattern.group(2) != None:
            new_db.write("month={{{0:s}}},\n".format(date_pattern.group(2)))
        continue
    if re.search("journaltitle",line):
        new_db.write(line.replace("journaltitle","journal"))
        continue
    new_db.write(line)
old_db.close()
new_db.close()

```

Best regards,  
Pablo

---

<div class="post-metadata">

**Author:** ![matthiasgeiger](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/matthiasgeiger/32/7_2.png) [@matthiasgeiger](https://discourse.jabref.org/u/matthiasgeiger)\
**Post date:** [July 30, 2017, 6:19pm UTC](https://discourse.jabref.org/t/revert-convert-to-biblatex-format/699/4 "2017-07-30T18:19:49Z")

</div>

Good to hear that you were able to restore your data!
