Lightning Channels Back Up Missing
<!-- Note: This website is for bug reports, not general questions.
Do not post issues about non-bitcoin versions of Electrum. -->

After saving a backup from my wallet where I have a Lightning Channel Opened, I restored the backup in another place (File.backup)

All other things worked correctly, all my labels were restored etc but none of the lightning channels were stored and I don't know where to find that option

Shouldn't this automatically save all Lightning BackUps? or at least, allow us to save those backups separately?
Nico
diff --git a/electrum/wallet.py b/electrum/wallet.py
index d29ef98bc..3ea1d2c23 100644
--- a/electrum/wallet.py
+++ b/electrum/wallet.py
@@ -318,7 +318,7 @@ class Abstract_Wallet(AddressSynchronizer, ABC):
         new_db = WalletDB(self.db.dump(), manual_upgrades=False)
 
         if self.lnworker:
-            channel_backups = new_db.get_dict('channel_backups')
+            channel_backups = new_db.get_dict('imported_channel_backups')
             for chan_id, chan in self.lnworker.channels.items():
                 channel_backups[chan_id.hex()] = self.lnworker.create_channel_backup(chan_id)
             new_db.put('channels', None)
diff --git a/electrum/wallet_db.py b/electrum/wallet_db.py
index 3a602c36d..e6c08f102 100644
--- a/electrum/wallet_db.py
+++ b/electrum/wallet_db.py
@@ -53,7 +53,7 @@ if TYPE_CHECKING:
 
 OLD_SEED_VERSION = 4        # electrum versions < 2.0
 NEW_SEED_VERSION = 11       # electrum versions >= 2.0
-FINAL_SEED_VERSION = 40     # electrum >= 2.7 will set this to prevent
+FINAL_SEED_VERSION = 41     # electrum >= 2.7 will set this to prevent
                             # old versions from overwriting new format
 
 
@@ -189,6 +189,7 @@ class WalletDB(JsonDB):
         self._convert_version_38()
         self._convert_version_39()
         self._convert_version_40()
+        self._convert_version_41()
         self.put('seed_version', FINAL_SEED_VERSION)  # just to be sure
 
         self._after_upgrade_tasks()
@@ -811,6 +812,15 @@ class WalletDB(JsonDB):
                 ks['seed_type'] = seed_type
         self.data['seed_version'] = 40
 
+    def _convert_version_41(self):
+        # this is a repeat of upgrade 39, to fix wallet backup files (see #7339)
+        if not self._is_upgrade_method_needed(40, 40):
+            return
+        imported_channel_backups = self.data.pop('channel_backups', {})
+        imported_channel_backups.update(self.data.get('imported_channel_backups', {}))
+        self.data['imported_channel_backups'] = imported_channel_backups
+        self.data['seed_version'] = 41
+
     def _convert_imported(self):
         if not self._is_upgrade_method_needed(0, 13):
             return
['electrum/wallet_db.py', 'electrum/wallet.py']