# 5.4 Config not saving correctly

**URL:** <https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [May 17, 2024, 8:55am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118 "2024-05-17T08:55:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zssork](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zssork/32/629783_2.png) [@Zssork](https://forums.unrealengine.com/u/Zssork)\
**Post date:** [May 17, 2024, 8:55am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118/1 "2024-05-17T08:55:26Z")

</div>

Since UE 5.4 everything that should be persisted in ini files is not getting saved properly. Load config from the `Game.ini` seems to work but not saving. I think it has to do with this here missing:

```auto
[SectionsToSave]
bCanSaveAllSections=true

```

I can add it manually and it is working again but i have the same issue with settings not saving in my build game. Is anyone else having the same issues and know how to solve this?

---

<div class="post-metadata">

**Author:** ![FrostyJas](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frostyjas/32/1194640_2.png) [@FrostyJas](https://forums.unrealengine.com/u/FrostyJas)\
**Post date:** [May 17, 2024, 9:56am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118/2 "2024-05-17T09:56:23Z")

</div>

Greetings @Zssork

I actually did see someone having similar issues with the DefaultEngine.ini. They ended up deleting it and regenerating a new one and it fixed the problem. I’m not sure if that will work here. But, I’d try it for a start. Let me know if that resolves it. Thanks!

---

<div class="post-metadata">

**Author:** ![Zssork](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zssork/32/629783_2.png) [@Zssork](https://forums.unrealengine.com/u/Zssork)\
**Post date:** [May 17, 2024, 10:01am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118/3 "2024-05-17T10:01:23Z")

</div>

thx, i can test it later but it would be not the best fix for that because we already have a demo released and it would be really bad if now everyone would need to delete the settings.

---

<div class="post-metadata">

**Author:** ![Zssork](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zssork/32/629783_2.png) [@Zssork](https://forums.unrealengine.com/u/Zssork)\
**Post date:** [May 17, 2024, 11:58am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118/4 "2024-05-17T11:58:31Z")

</div>

sadly deleting the config ini files does not solve this issue

---

<div class="post-metadata">

**Author:** ![Hyaniner](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hyaniner/32/1194580_2.png) [@Hyaniner](https://forums.unrealengine.com/u/Hyaniner)\
**Post date:** [May 22, 2024, 8:34am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118/6 "2024-05-22T08:34:48Z")

</div>

In UCLASS(config = SomeName), I added the word “Editor” to “SomeName”, then SaveConfig() worked. Maybe if you add “User”, it will work.

Within my debugging, I found this.

[https://github.com/EpicGames/UnrealEngine/blob/16dc333db3d6439c7f2886cf89db8907846c0e8a/Engine/Source/Runtime/Core/Private/Misc/ConfigContext.cpp#L403-L423](https://github.com/EpicGames/UnrealEngine/blob/16dc333db3d6439c7f2886cf89db8907846c0e8a/Engine/Source/Runtime/Core/Private/Misc/ConfigContext.cpp#L403-L423)

```cpp

		// check if the config file wants to save all sections
		bool bLocalSaveAllSections = false;
		// Do not report the read of SectionsToSave. Some ConfigFiles are reallocated without it, and reporting
		// logs that the section disappeared. But this log is spurious since if the only reason it was read was
		// for the internal save before the FConfigFile is made publicly available.
		const FConfigSection* SectionsToSaveSection = ConfigFile->FindSection(SectionsToSaveString);
		if (SectionsToSaveSection)
		{
			const FConfigValue* Value = SectionsToSaveSection->Find(SaveAllSectionsKey);
			if (Value)
			{
				const FString& ValueStr = UE::ConfigCacheIni::Private::FAccessor::GetValueForWriting(*Value);
				bLocalSaveAllSections = FCString::ToBool(*ValueStr);
			}
		}

		// we can always save all sections of a User config file, Editor* (not Editor.ini tho, that is already handled in the normal method)
		bool bIsUserFile = BaseIniName.Contains(TEXT("User"));
		bool bIsEditorSettingsFile = BaseIniName.Contains(TEXT("Editor")) && BaseIniName != TEXT("Editor");

		ConfigFile->bCanSaveAllSections = bLocalSaveAllSections || bIsUserFile || bIsEditorSettingsFile;

```

---

<div class="post-metadata">

**Author:** ![Zssork](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zssork/32/629783_2.png) [@Zssork](https://forums.unrealengine.com/u/Zssork)\
**Post date:** [May 22, 2024, 5:35pm UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118/7 "2024-05-22T17:35:42Z")

</div>

thx for the response. I was using `Config = Game`. I now just added these lines to the `DefaultGame.ini` and other default files and it seems to work

```auto
[SectionsToSave]
bCanSaveAllSections=true

```

But with the code you showed it makes sense why it wont save it. But tbh its a wierd behaviour and i did not find any documentation or notice from epic about this change

---

<div class="post-metadata">

**Author:** ![Hyaniner](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hyaniner/32/1194580_2.png) [@Hyaniner](https://forums.unrealengine.com/u/Hyaniner)\
**Post date:** [May 23, 2024, 1:04am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118/8 "2024-05-23T01:04:05Z")

</div>

It was hard to believe me to see that code, too. Also, it was hard to believe that the document or notice did not comment on it. But I understand things like this sometimes happen in large organizations. I guess there must have been some unavoidable circumstances.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 22, 2024, 1:04am UTC](https://forums.unrealengine.com/t/5-4-config-not-saving-correctly/1860118/9 "2024-06-22T01:04:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
