Index: /controller/wpsg_AdminController.class.php
===================================================================
--- /controller/wpsg_AdminController.class.php	(revision 7237)
+++ /controller/wpsg_AdminController.class.php	(revision 7238)
@@ -1610,4 +1610,50 @@
 		{
 
+			if (isset($_REQUEST['migrateAttachmentToMediathek'])) {
+				
+				$old_attachment = $this->get_option('wpsg_kundenmail_attachfile');				
+				$file = wpsg_getUploadDir('wpsg_mailconf').$old_attachment;
+				
+				if (wpsg_isSizedString($old_attachment) && file_exists($file)) {
+					
+					$wp_upload_dir = wp_upload_dir();
+					
+					$attachment = array(
+						'guid' => $wp_upload_dir['url'].'/'.basename($file),
+						'post_mime_type' => 'application/pdf',
+						'post_title' => 'Migrierter Anhang aus altem Kundenanhang',
+						'post_content' => 'Migrierter Anhang aus altem Kundenanhang',
+						'post_status' => 'inherit'
+					);
+					
+					copy($file,$wp_upload_dir['path'].'/'.basename($file));
+					
+					$image_id = wp_insert_attachment($attachment, $wp_upload_dir['path'].'/'.basename($file), 0);
+					
+					//require_once(ABSPATH.'wp-admin/includes/image.php');					
+					//$attach_data = wp_generate_attachment_metadata($image_id, basename($file));					
+					//wp_update_attachment_metadata($image_id, $attach_data);
+					
+					$oldIDs = $this->shop->get_option('wpsg_kundenmail_mediaattachment');
+					$oldIDs = explode(',', $oldIDs);
+					
+					$oldIDs[] = $image_id;
+					
+					$oldIDs = array_unique($oldIDs); wpsg_trim($oldIDs);
+					
+					$GLOBALS['wpsg_sc']->update_option('wpsg_kundenmail_mediaattachment', implode(',', $oldIDs));
+					
+					@unlink($file);
+					$this->shop->update_option('wpsg_kundenmail_attachfile', false);
+					
+				}
+				
+				$this->shop->addBackendMessage(__('Anhang migriert.', 'wpsg'));
+				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf');
+
+				exit;
+				
+			}
+			
 			if (isset($_REQUEST['submit']))
 			{
Index: /wpshopgermany.php
===================================================================
--- /wpshopgermany.php	(revision 7237)
+++ /wpshopgermany.php	(revision 7238)
@@ -1,4 +1,4 @@
 <?php
-
+	
 	/*
 	Plugin Name: wpShopGermany
@@ -248,4 +248,3 @@
     add_action('wpsg_daily_hook', [$GLOBALS['wpsg_sc'], 'wpsg_daily_hook']);
     
-	$GLOBALS['wpsg_sc']->callMods('load', array());
- 
+	$GLOBALS['wpsg_sc']->callMods('load', array()); 
