Compare commits

..

2 Commits

  1. 2
      lib/Migration/BackgroundJob.php
  2. 9
      scripts/user_data_migrate.py

@ -59,7 +59,7 @@ class BackgroundJob extends QueuedJob {
* @param array $argument
*/
protected function run($argument) {
$this->logger->debug("Starting job {$this->getId()} with args $argument");
$this->logger->debug("Starting job {$this->getId()} with args " . json_encode($argument));
$uid = $argument['uid'];
$user = $this->userManager->get($uid);
$type = $argument['type'];

@ -81,12 +81,19 @@ def main(src_path: str, dest_path: str, src_php: str, dest_php: str, src_remote:
max_users = len(users)
for idx, user in enumerate(users):
src_user_files = f"{src_data}/{user}/files/"
print(f"{'='*20}[{user} ({idx+1}/{max_users})]{'='*20}")
sys_stdout.flush()
# Check if user folder exist
if run_command(["test", "-d", src_user_files], src_remote, ssh_args, check=False).returncode != 0:
print("No files...")
continue
run(["rsync", "-avzPh", "--del",
"-e", f"ssh {' '.join(ssh_args)}",
f"{f'{src_remote}:' if src_remote else ''}{src_data}/{user}/files/",
f"{f'{src_remote}:' if src_remote else ''}{src_user_files}",
f"{f'{dest_remote}:' if dest_remote else ''}{dest_data}/{users[user]['email']}/"],
check=True, stdout=None, stderr=None)

Loading…
Cancel
Save