---
title: "@ConvertFrom"
---

`@ConvertFrom` provides the deserializer with the path and file name of a pre-existing config file from an old config library.

Supported file types:
* `.toml`
* `.json`
* `.json5`
* `.jsonc`

The below example will read an old file `./minecraft/config/example/config.json` and scrape relevant data from it by converting it to TOML first and then using that converted file as input to the deserializer. The old file will be deleted afterward.

<CodeTabs>

```java !!tabs Java
@ConvertFrom(fileName = "config.json", folder = "example")
public class ConfigImpl extends Config {
    public ConfigImpl {
        super(new Identifier.of("example", "config"));
    }
    //config stuff go here
}
```

```kotlin !!tabs Kotlin
@ConvertFrom("config.json", "example")
class ConfigImpl: Config(Identifier.of("example", "config")) {
    //config stuff go here
}
```

</CodeTabs>

<Callout>
See the documentation page <a target="_blank" rel="noopener" href="https://fzzyhmstrs.github.io/fconfig/-fzzy%20-config/me.fzzyhmstrs.fzzy_config.annotations/-convert-from/index.html">here 🗗</a>
</Callout>