3333use OCA \UserMigration \Exception \UserMigrationException ;
3434use OCA \UserMigration \ExportDestination ;
3535use OCA \UserMigration \IExportDestination ;
36- use OCA \UserMigration \IExportOperation ;
3736use OCA \UserMigration \IImportSource ;
37+ use OCA \UserMigration \IMigrationOperation ;
3838use OCA \UserMigration \ImportSource ;
3939use OC \Files \AppData ;
4040use OC \Files \Filesystem ;
@@ -156,10 +156,10 @@ public function export(IUser $user, ?OutputInterface $output = null): string {
156156 $ context = $ this ->coordinator ->getRegistrationContext ();
157157
158158 if ($ context !== null ) {
159- foreach ($ context ->getExportOperations () as $ registration ) {
160- /** @var IExportOperation $operation */
159+ foreach ($ context ->getMigrationOperations () as $ registration ) {
160+ /** @var IMigrationOperation $operation */
161161 $ operation = $ this ->container ->get ($ registration ->getService ());
162- $ operation ->run ($ registration ->getAppId (), $ user , $ exportFolder );
162+ $ operation ->export ($ registration ->getAppId (), $ user , $ exportDestination , $ output );
163163 }
164164 }
165165
@@ -181,6 +181,18 @@ public function import(string $path, ?OutputInterface $output = null): void {
181181 $ this ->importAccountInformation ($ user , $ importSource , $ output );
182182 $ this ->importAppsSettings ($ user , $ importSource , $ output );
183183 $ this ->importFiles ($ user , $ importSource , $ output );
184+
185+ // Run imports for other apps
186+ $ context = $ this ->coordinator ->getRegistrationContext ();
187+
188+ if ($ context !== null ) {
189+ foreach ($ context ->getMigrationOperations () as $ registration ) {
190+ /** @var IMigrationOperation $operation */
191+ $ operation = $ this ->container ->get ($ registration ->getService ());
192+ $ operation ->import ($ registration ->getAppId (), $ user , $ importSource , $ output );
193+ }
194+ }
195+
184196 $ uid = $ user ->getUID ();
185197 $ output ->writeln ("Successfully imported $ uid from $ path " );
186198 } finally {
0 commit comments