Virtualmin restore being killed by OOM KIller

We have a strange issue with our Virtualmin server. We have Virtualmin LEMP installed on EC2 instance (t3a.medium) with 4GB RAM. We have like 20 WordPress site on another Virtualmin server and trying to migrate. But it’s failing due to low memory.

We’re trying to restore one virtual server at a time. Total size of the backup file is around 350MB. We first tried the restore from command line without a swap file. It failed, then we added a swap file of 4GB still failed. Then increased it to 8GB and still failed.

Following are log entries,
Feb 21 06:32:07 sr kernel: [ 3853.851813] Out of memory (oom_kill_allocating_task): Kill process 6916 (in:imklog) score 0 or sacrifice child
Feb 21 06:32:07 sr kernel: [ 3853.860401] Killed process 6904 (rsyslogd) total-vm:256388kB, anon-rss:736kB, file-rss:668kB
Feb 21 06:32:07 sr kernel: [ 3854.126825] Out of memory (oom_kill_allocating_task): Kill process 10102 (/usr/share/webm) score 0 or sacrifice child
Feb 21 06:32:07 sr kernel: [ 3854.135305] Killed process 10102 (/usr/share/webm) total-vm:10949404kB, anon-rss:3739484kB, file-rss:956kB

This is the search result for keyword OOM on syslog,
Feb 21 06:32:06 sr kernel: [ 3853.234084] [] oom_kill_process+0x20b/0x3d0
Feb 21 06:32:06 sr kernel: [ 3853.234213] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
Feb 21 06:32:06 sr kernel: [ 3853.234490] Out of memory (oom_kill_allocating_task): Kill process 3287 (php-fpm7.0) score 0 or sacrifice child
Feb 21 06:32:06 sr kernel: [ 3853.252698] Out of memory (oom_kill_allocating_task): Kill process 3287 (php-fpm7.0) score 0 or sacrifice child
Feb 21 06:32:07 sr kernel: [ 3853.851813] Out of memory (oom_kill_allocating_task): Kill process 6916 (in:imklog) score 0 or sacrifice child
Feb 21 06:32:07 sr kernel: [ 3854.126825] Out of memory (oom_kill_allocating_task): Kill process 10102 (/usr/share/webm) score 0 or sacrifice child

We’ve configured OOM to kill the allocating task just so we can complete the restore. But with no luck. Following is a screenshot of htop during the restore,
https://gyazo.com/7055a06cc5642a7b24bcb78ebd575107

Any help will be highly appreciated.
Thanks!