diff --git a/common/settings/common_settings.cpp b/common/settings/common_settings.cpp
index 136b181676..241c1afdf4 100644
--- a/common/settings/common_settings.cpp
+++ b/common/settings/common_settings.cpp
@@ -18,6 +18,7 @@
* with this program. If not, see .
*/
+#include
#include
#include
#include
@@ -28,6 +29,16 @@
using KIGFX::MOUSE_DRAG_ACTION;
+///! The following environment variables will never be migrated from a previous version
+const std::set envVarBlacklist =
+ {
+ wxT( "KICAD6_SYMBOL_DIR" ),
+ wxT( "KICAD6_FOOTPRINT_DIR" ),
+ wxT( "KICAD6_TEMPLATES_DIR" ),
+ wxT( "KICAD6_3DMODEL_DIR" )
+ };
+
+
///! Update the schema version whenever a migration is required
const int commonSchemaVersion = 1;
@@ -250,6 +261,12 @@ bool COMMON_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
while( aCfg->GetNextEntry( key, index ) )
{
+ if( envVarBlacklist.count( key ) )
+ {
+ wxLogTrace( traceSettings, "Migrate Env: %s is blacklisted; skipping.", key );
+ continue;
+ }
+
value = aCfg->Read( key, wxEmptyString );
if( !value.IsEmpty() )