Trying to use legacy backup to clone but get error folder can't be created

I want to use the clone extension, I am on cloudways. I am getting an error after it starts to download from child and it says mainwp can’t write a folder?

---------- error I get ---------

10:23 am Creating the backup file on the child site, this might take a while depending on the size. Please be patient.

10:23 am Backup file on child site created successfully!
10:23 am Downloading the file.

10:23 am ERROR: MainWP plugin could not create directory in order to download the file.
10:23 am Backup failed!

What is the place where this folder should be created/written to? What ownership and permissions?

I also can’t seem to change the memory to 256MB - I did so in the wp-config using a remote IDE. Do I need to restart the cloudways app somehow? I also do not know how to change the curl timeout.

Sorry, I just installed mainwp on a fresh site this weekend and am new to it all. I have about a half dozen child sites connected right now. Everything else seems to work fine. I want to be able to do quick clones if possible.

Thanks for any guidance. My copy/paste is below.
Thanks, Jamie

### WordPress Check                Required                                               Detected                                     Status   ###

FileSystem Method                  = direct                                               direct                                       Pass        
MultiSite Disabled                 =true                                                  true                                         Pass        
WordPress Memory Limit             >=64M                                                  40M                                          Warning     
WordPress Version                  >=3.6                                                  6.1.1                                        Pass        

### PHP                            Required                                               Detected                                     Status   ###

cURL Extension Enabled             =true                                                  true                                         Pass        
cURL SSL Version                   >=OpenSSL/1.1.0                                        OpenSSL/1.1.1n                               Pass        
cURL Timeout                       >=300 seconds                                          60                                           Warning     
cURL Version                       >=7.29.0                                               7.64.0                                       Pass        
PCRE Backtracking Limit            >=10000                                                1000000                                      Pass        
PHP Allow URL fopen                N/A                                                    YES                                                      
PHP Disabled Functions             N/A                                                    , pcntl_alarm, pcntl_async_signals, pcntl_exec, pcntl_fork, pcntl_get_last_error, pcntl_getpriority, pcntl_setpriority, pcntl_signal, pcntl_signal_dispatch, pcntl_signal_get_handler, pcntl_sigprocmask, pcntl_sigtimedwait, pcntl_sigwaitinfo, pcntl_strerror, pcntl_unshare, pcntl_wait, pcntl_waitpid, pcntl_wexitstatus, pcntl_wifcontinued, pcntl_wifexited, pcntl_wifsignaled, pcntl_wifstopped, pcntl_wstopsig, pcntl_wtermsig,            
PHP Exif Support                   N/A                                                    YES ( V8.1.)                                             
PHP IPTC Support                   N/A                                                    YES                                                      
PHP Loaded Extensions              N/A                                                    Core, FFI, PDO, PDO_Firebird, PDO_ODBC, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apcu, bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, igbinary, imagick, imap, intl, json, libxml, mbstring, memcached, mongodb, msgpack, mysqli, mysqlnd, odbc, openssl, pcre, pdo_dblib, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, posix, readline, redis, session, shmop, soap, sockets, sodium, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib            
PHP Max Execution Time             >=30 seconds                                           300                                          Pass        
PHP Max Input Time                 >=30 seconds                                           60                                           Pass        
PHP Memory Limit                   >=128M                                                 256M                                         Pass        
PHP Post Max Size                  >=2M                                                   40M                                          Pass        
PHP Safe Mode Disabled             =true                                                  true                                         Pass        
PHP Upload Max Filesize            >=2M                                                   40M                                          Pass        
PHP Version                        >=7.0                                                  8.1.14                                       Pass        
PHP XML Support                    N/A                                                    YES                                                      
SSL Extension Enabled              =true                                                  true                                         Pass        
SSL Warnings                       = empty                                                error:24070079:random number generator:RAND_write_file:Cannot open fileWarning     

### MySQL                          Required                                               Detected                                     Status   ###

MySQL Client Encoding              N/A                                                    utf8                                                     
MySQL Mode                         N/A                                                    ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION            
MySQL Version                      >=5.0                                                  10.4.20-MariaDB-1:10.4.20+maria~buster-log   Pass        

### Server Configuration           Detected Value                                      ###

Accept Content                     text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Charset Content             N/A                                                    
Architecture                       64		 bit                                               
Gateway Interface                  CGI/1.1                                                
HTTPS                              ON                                                     
Memory Usage                       10.94 MB                                               
Operating System                   Linux                                                  
Request Time                       1675650314                                             
Server Protocol                    HTTP/1.0                                               
Server self connect                Not expected HTTP response body:                       
Server Software                    Apache/2.4.54 (Debian)                                 
User Agent                         Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

### MainWP Dashboard Settings      Detected Value                                      ###

Abandoned plugins/themes tolerance 365                                                    
Basic uptime monitoring enabled    Yes                                                    
Cache control enabled              No                                                     
MainWP Dashboard Version           Latest: 4.3.1 | Detected: 4.3.1 Pass                   
MainWP legacy backups enabled      Yes                                                    
Maximum number of pages to return  50                                                     
Maximum number of posts to return                                                         
Maximum simultaneous install and update requests                                                       
Maximum simultaneous requests      4                                                      
Maximum simultaneous requests per ip1                                                      
Maximum simultaneous sync requests                                                        
Minimum delay between requests     200                                                    
Minimum delay between requests to the same ip1000                                                   
Number of child sites              6                                                      
Optimize for shared hosting or big networksNo                                                     
Plugin advanced automatic updates enabledYes                                                    
Primary backup system              MainWP Legacy Backups                                  
REST API enabled                   No                                                     
Site health monitoring enabled     Yes                                                    
Theme advanced automatic updates enabledYes                                                    
Use WP Cron                        No                                                     
WP Core advanced automatic updates enabledYes                                                    

### Extensions                     Version                                                License                                      Status   ###

MainWP Clone Extension             4.0.3                                                  Actived                                      Pass        
MainWP White Label Extension       4.1.3                                                  Actived                                      Pass        

### Plugin                         Version                                                Status                                    ###

MainWP Dashboard                   4.3.1                                                  Active                                       
Page Builder Framework Premium Addon2.9.1                                                  Active                                       
WP 2FA - Two-factor authentication for WordPress2.4.0                                                  Active                                       

Hey @Jamie

Can you please try installing this version of MainWP Child plugin on both relevant child sites (the source and destination of Clone), and see if that helps?

You can find information about resolving system requirements in this help article: Resolving System Requirement Issues - MainWP Documentation

On Cloudways, PHP-FPM settings should be the place to change memory settings or cURL timeout: How to Change PHP-FPM Settings | Cloudways Help Center

The host support should be able to assist you if you feel uncomfortable making those changes yourself.

I have cloning from child to child direcctly working. But I still get an error on a backup. Here is what I have done:

  1. I installed the new that you sent me, on both the existing site and target site.
  2. In cloudways in each app, including the 2 child sites and my mainwp site, I used the cloudways application settings - php fpm settings (a built-in editor), and established these to correct the warnings:


Note: on the above, I was originally not un-commenting lines by removing the lead semicolon.

So cloning from the mainwp settings, selecting a source of the clone to be written over the site I am in, that works perfectly. At least on relatively small sized test sites. I will keep testing larger ones, but this seems very good for my needs.

But when I use the built-in backup, It does the backup on the child site but appears to not be writing the file in the mainwp site:

4:10 pm Creating the backup file on the child site, this might take a while depending on the size. Please be patient.

4:10 pm Backup file on child site created successfully!
4:10 pm Downloading the file.

4:10 pm ERROR: MainWP plugin could not create directory in order to download the file.
4:10 pm Backup failed!

I ssh from a terminal and checked the permission on both the mainwp site and the child site. Both appear to me to be have good permissions and consistent ownership. I assume the mainwp plugin has same owner and permission as the wp site itself? Here is what I see:

[email protected] ~/public_html/wp-content $ cd uploads
[email protected] ~/public_html/wp-content/uploads $ ls -all
total 16
drwxrwxr-x 4 xabbtnsjhv www-data 4096 Feb  4 20:38 .
drwxrwxr-x 6 xabbtnsjhv www-data 4096 Feb  4 20:38 ..
drwxrwxr-x 3 xabbtnsjhv www-data 4096 Feb  4 20:20 2023
drwxrwxrwx 7 xabbtnsjhv www-data 4096 Feb  5 06:01 mainwp
[email protected] ~/public_html/wp-content/uploads $ cd mainwp
[email protected] ~/public_html/wp-content/uploads/mainwp $ ls -all
total 28
drwxrwxrwx 7 xabbtnsjhv www-data 4096 Feb  5 06:01 .
drwxrwxr-x 4 xabbtnsjhv www-data 4096 Feb  4 20:38 ..
drwxrwxrwx 2 xabbtnsjhv www-data 4096 Feb  4 21:37 client-images
drwxrwxrwx 2 xabbtnsjhv www-data 4096 Feb  5 15:03 cookies
drwxrwxrwx 2 xabbtnsjhv www-data 4096 Feb  5 18:48 icons
-rw-rw-r-- 1 xabbtnsjhv www-data    0 Feb  4 20:38 index.php
drwxrwxrwx 3 xabbtnsjhv www-data 4096 Feb  5 00:58 templates
drwxrwxrwx 2 xabbtnsjhv www-data 4096 Feb  4 21:30 themes

What should I try now?

NOTE: I have used updraftplus on other wp sites, so if I need to I will try that. BUT I would like to understand why it is failing above.

Can you try Option 2 so that we can be sure that the issue is the inability to create a directory?

With Option 2, you would have to manually upload the backup file to the destination child site (via FTP or other means) and then try restoring from that file.

You can find step-by-step instructions for Option 2 at this link: Clone WordPress Site (Clone from Backup) - MainWP Documentation


I have the same problem. Normal Child cloning apparently works but it actually never finished (Website is bigger than 200mb), thats why I also wanted to try the possibility to clone with the Backup File, but then yet again I get the same Error as @Jamie

Best Regards

Hi Ivi,
On the backup error:
Just an FYI. I opened a support ticket on this a few days ago and they are logging onto my sites to debug. If I find out anything I will post it back here. I am curious why it is giving the error about not being able to make a file - as I have checked the permissions and also had my host Cloudways check too.

On the cloning:
I haven’t tried large site to site cloning yet. The smaller test sites I cloned worked fine after I changed my timeout stuff. Maybe a huge site clone requires a lot of time for the transfer and it times out? As soon as they are domne working on the backup error, I will test some big site to site clones. I have a few I want to move from one hosting platform to cloudways, so will be a good test.

Peace, Jamie

1 Like

Hi Jamie,

wow thank you for infos. I also tried this on my own server, with all of the possible permission giving. Only thing which I haven’t thought about was maybe SSL, but it wouldn’t make any sense I think.

On the cloning:
I’ll also try few more tricks and let you know if it works.
(We are just trying to make some new staging/cloning workflows within MainWP, because our users can have different hosting providers and it needs to be stable).

Hi Ivi,
FYI progress on the support ticket: I gave them logins to my mainwp and a child site I was trying to backup. They verified the error. And I gave them ssh access to those sites as well, and they told me the development team is working it.

I am very impressed with the premium support they are giving me on this issue. I use Cloudways and these were fresh and clean WordPress installs - so I was pretty sure it wasn’t something dumb I did on my end, though I am very capable of doing dumb things lol.

Hopefully they come to a quick resolution that can fix not just mine but your situation too :slight_smile: :smiley:

Just out of curiosity, in what context are you using mainwp? I am brand new to this, but it looks perfect for my application. I am starting a training site teaching people how to build various types of micro-businesses and micro-SaaS apps using WordPress as the dev framework. To help people over the beginning technical hurdles, I provide a WordPress dev install, so they can start working on things without getting a host, installing WP, etc. But I could see how managing a ton of little dev website apps could be hard, and that is how I found mainwp. I have hooked it to a bunch of my own projects as a test and it is cool.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.