# Is it Possible to Run a System Update Except One File?

**URL:** <https://hub.mender.io/t/is-it-possible-to-run-a-system-update-except-one-file/3528>\
**Category:** General Discussions\
**Created:** [April 19, 2021, 10:36pm UTC](https://hub.mender.io/t/is-it-possible-to-run-a-system-update-except-one-file/3528 "2021-04-19T22:36:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShiromMakkad](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/shirommakkad/32/1128_2.png) [@ShiromMakkad](https://hub.mender.io/u/ShiromMakkad)\
**Post date:** [April 19, 2021, 10:36pm UTC](https://hub.mender.io/t/is-it-possible-to-run-a-system-update-except-one-file/3528/1 "2021-04-19T22:36:07Z")

</div>

I want to pass images to Mender to update the entire device, but there’s one .json file that stores the user’s configuration. I want to preserve this file and place it in the same place after the update. Even if there’s not an explicit way of doing this, is it possible to create a script to copy the file to some temporary location and move it into the new version after the system update?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [April 19, 2021, 11:27pm UTC](https://hub.mender.io/t/is-it-possible-to-run-a-system-update-except-one-file/3528/2 "2021-04-19T23:27:03Z")

</div>

There are basically two ways to achieve this:

1. Permanently store the JSON file in the /data partition. This will ensure it is never touched by a full image update.
2. Use [state scripts](https://docs.mender.io/overview/state-script) to backup and restore the file. You can use an ArifactInstall\_Enter script to back up the existing one and an ArtifactCommit\_Enter script to restore the backup into the new rootfs.

Drew

---

<div class="post-metadata">

**Author:** ![ShiromMakkad](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/shirommakkad/32/1128_2.png) [@ShiromMakkad](https://hub.mender.io/u/ShiromMakkad)\
**Post date:** [April 20, 2021, 1:50am UTC](https://hub.mender.io/t/is-it-possible-to-run-a-system-update-except-one-file/3528/3 "2021-04-20T01:50:01Z")

</div>

For the state scripts, would I backup the file to the /data partition and restore it from there, or is there some place I can put files to be accessed by different state scripts that won’t be modified during the system update?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [April 20, 2021, 3:14pm UTC](https://hub.mender.io/t/is-it-possible-to-run-a-system-update-except-one-file/3528/4 "2021-04-20T15:14:33Z")

</div>

Using the /data partition is probably the right approach.

Drew
