@@ -84,8 +84,6 @@ public function handle()
8484 */
8585 protected function createS3Directories (): void
8686 {
87- \Log::info ('Creating S3 directories... ' );
88-
8987 $ directories = [
9088 config ('config.uploads.site-assets ' ),
9189 config ('config.uploads.project-assets ' ),
@@ -95,25 +93,18 @@ protected function createS3Directories(): void
9593 try {
9694 if (! Storage::disk ('s3 ' )->exists ($ directory )) {
9795 Storage::disk ('s3 ' )->makeDirectory ($ directory );
98- \Log::info ("Created directory: {$ directory }" );
99- } else {
100- \Log::info ("Directory already exists: {$ directory }" );
10196 }
10297 } catch (\Exception $ e ) {
10398 $ this ->error ("Failed to create directory {$ directory }: " .$ e ->getMessage ());
10499 }
105100 }
106-
107- \Log::info ('S3 directory creation completed. ' );
108101 }
109102
110103 /**
111104 * Move files between S3 directories using AWS CLI for optimal performance
112105 */
113106 protected function moveS3DirectoryFiles (): void
114107 {
115- \Log::info ('Moving S3 directory files... ' );
116-
117108 $ bucket = config ('filesystems.disks.s3.bucket ' );
118109 $ region = config ('filesystems.disks.s3.region ' );
119110
@@ -133,17 +124,13 @@ protected function moveS3DirectoryFiles(): void
133124 foreach ($ migrations as $ migration ) {
134125 $ this ->migrateS3Directory ($ bucket , $ region , $ migration ['from ' ], $ migration ['to ' ], $ migration ['name ' ]);
135126 }
136-
137- \Log::info ('S3 directory file migration completed. ' );
138127 }
139128
140129 /**
141130 * Migrate files from one S3 directory to another using AWS CLI
142131 */
143132 protected function migrateS3Directory (string $ bucket , string $ region , string $ fromDir , string $ toDir , string $ description ): void
144133 {
145- \Log::info ("Migrating {$ description }: {$ fromDir } → {$ toDir }" );
146-
147134 // Check if source directory has files
148135 $ listCommand = sprintf (
149136 'aws s3 ls s3://%s/%s/ --region %s --recursive ' ,
@@ -157,13 +144,10 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
157144 exec ($ listCommand .' 2>/dev/null ' , $ output , $ returnCode );
158145
159146 if (empty ($ output )) {
160- \Log::info (" No files found in source directory: {$ fromDir }" );
161-
162147 return ;
163148 }
164149
165150 $ fileCount = count ($ output );
166- \Log::info (" Found {$ fileCount } files to migrate " );
167151
168152 // Get initial count of destination directory
169153 $ destListCommand = sprintf (
@@ -180,9 +164,6 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
180164 $ initialDestFileCount = count ($ destInitialOutput );
181165 $ expectedFinalCount = $ initialDestFileCount + $ fileCount ;
182166
183- \Log::info (" Initial destination files: {$ initialDestFileCount }" );
184- \Log::info (" Expected final count: {$ expectedFinalCount }" );
185-
186167 // Copy files to new directory
187168 $ copyCommand = sprintf (
188169 'aws s3 cp s3://%s/%s/ s3://%s/%s/ --region %s --recursive ' ,
@@ -193,7 +174,6 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
193174 escapeshellarg ($ region )
194175 );
195176
196- \Log::info (' Copying files... ' );
197177 $ copyOutput = [];
198178 $ copyReturnCode = 0 ;
199179 exec ($ copyCommand .' 2>&1 ' , $ copyOutput , $ copyReturnCode );
@@ -204,8 +184,6 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
204184 return ;
205185 }
206186
207- \Log::info (' Files copied successfully ' );
208-
209187 // Verify copy operation by listing destination directory
210188 $ verifyOutput = [];
211189 $ verifyReturnCode = 0 ;
@@ -218,20 +196,13 @@ protected function migrateS3Directory(string $bucket, string $region, string $fr
218196
219197 return ;
220198 }
221-
222- \Log::info (" Verification successful: {$ actualFinalCount } files in destination " );
223-
224- \Log::info (" ✅ Migration completed: {$ description }" );
225- \Log::info (" Original files preserved in: {$ fromDir }" );
226199 }
227200
228201 /**
229202 * Update database paths for moved files
230203 */
231204 protected function updateDatabasePaths (): void
232205 {
233- \Log::info ('Updating database paths... ' );
234-
235206 // Update ProjectAsset paths from project-resources/downloads to project-assets
236207 $ oldProjectPath = config ('config.uploads.project_resources_downloads ' );
237208 $ newProjectPath = config ('config.uploads.project-assets ' );
@@ -241,19 +212,13 @@ protected function updateDatabasePaths(): void
241212 ->get ();
242213
243214 if ($ projectAssetUpdates ->isNotEmpty ()) {
244- \Log::info (" Updating {$ projectAssetUpdates ->count ()} ProjectAsset records... " );
245-
246215 foreach ($ projectAssetUpdates as $ asset ) {
247216 $ newPath = str_replace ($ oldProjectPath , $ newProjectPath , $ asset ->download_path );
248217
249218 DB ::table ('project_assets ' )
250219 ->where ('id ' , $ asset ->id )
251220 ->update (['download_path ' => $ newPath ]);
252-
253- \Log::info (" Updated ProjectAsset {$ asset ->id }: {$ asset ->download_path } → {$ newPath }" );
254221 }
255- } else {
256- \Log::info (' No ProjectAsset records to update ' );
257222 }
258223
259224 // Update SiteAsset paths from resources to site-assets
@@ -265,22 +230,14 @@ protected function updateDatabasePaths(): void
265230 ->get ();
266231
267232 if ($ siteAssetUpdates ->isNotEmpty ()) {
268- \Log::info (" Updating {$ siteAssetUpdates ->count ()} SiteAsset records... " );
269-
270233 foreach ($ siteAssetUpdates as $ asset ) {
271234 $ newPath = str_replace ($ oldSitePath , $ newSitePath , $ asset ->download_path );
272235
273236 DB ::table ('site_assets ' )
274237 ->where ('id ' , $ asset ->id )
275238 ->update (['download_path ' => $ newPath ]);
276-
277- \Log::info ("Updated SiteAsset {$ asset ->id }: {$ asset ->download_path } → {$ newPath }" );
278239 }
279- } else {
280- \Log::info ('No SiteAsset records to update ' );
281240 }
282-
283- \Log::info ('Database path updates completed. ' );
284241 }
285242
286243 public function processClassifications (): void
0 commit comments