flydev

Duplicator: Backup and move sites

Recommended Posts

So, after multiple tries to code a function which could zip a folder and could lead to be extracted on both platforms (win/unix) failed. The function I built (which I think can work on both platforms) lead to a ZipArchive error: NO ERROR on Windows and thus the zip file is not finalized 😤😤

it irks me, if someone has a function which work on both platform please post it here ✌️

 

Share this post


Link to post
Share on other sites
Posted (edited)
50 minutes ago, flydev said:

So, after multiple tries to code a function which could zip a folder and could lead to be extracted on both platforms (win/unix) failed. The function I built (which I think can work on both platforms) lead to a ZipArchive error: NO ERROR on Windows and thus the zip file is not finalized 😤😤

it irks me, if someone has a function which work on both platform please post it here ✌️

 

I haven't been following the zip conversation closely but don't ProcessWire's inbuilt functions not work? wireZipFile() has never failed me and more lately $files->zip(). I've just tried the following (example from the Docs) on my local Windows machine (EDIT: not  a Windows Server though!) and remote linux machine and $files->zip() worked without errors (nested folders; PW 3.x):

 

// Create zip of all files in directory $dir to file $zip
$dir = $config->paths->cache . "my-files/";
$zip = $config->paths->cache . "my-file.zip";
$result = $files->zip($zip, $dir);

echo "<h3>These files were added to the ZIP:</h3>";
foreach($result['files'] as $file) {
  echo "<li>" . $sanitizer->entities($file) . "</li>";
}

if(count($result['errors'])) {
  echo "<h3>There were errors:</h3>";
  foreach($result['errors'] as $error) {
    echo "<li>" . $sanitizer->entities($error) . "</li>";
  }
}

 

Edited by kongondo
windows not windows server!
  • Like 1

Share this post


Link to post
Share on other sites

Thanks @kongondo,

from what I remember, the main reason I didn't used this function is because it doesn't work with the exclude feature.

Maybe I am wrong, I will look more closer at the function's code.

Share this post


Link to post
Share on other sites
20 minutes ago, flydev said:

exclude feature

Is this a duplicator feature?

Share this post


Link to post
Share on other sites

yes,

and I know I can exclude files directly in WireZipFile() but I can't apply a filter on the iterator. Now, writing this post, I have an idea which could work.

Share this post


Link to post
Share on other sites

Did you see $options in $files? The exclude (array)?

  • Like 1

Share this post


Link to post
Share on other sites

Yes, but there is a feature to exclude files by extension - not tested a wildcard in the core function - which can't work "as is" with this function.

 

Maybe I should return an array of all files (from an extension provided) and passing this array to the function. This should work.

Share this post


Link to post
Share on other sites
3 minutes ago, flydev said:

Maybe I should return an array of all files (from an extension provided) and passing this array to the function. This should work.

I think it would work. $files->($zip, array|string $files)

  • Like 2

Share this post


Link to post
Share on other sites

Okay, thanks @kongondo, you put me on the right track. The zip file can be extracted on Windows and Unix, but the "extension feature" doesn't work.  Will find a workaround.  Thanks again :)

  • Like 1

Share this post


Link to post
Share on other sites
26 minutes ago, flydev said:

Okay, thanks @kongondo, you put me on the right track. The zip file can be extracted on Windows and Unix :)

Glad that part work.

27 minutes ago, flydev said:

....but the "extension feature" doesn't work.  Will find a workaround.

Hmm. Doesn't work on both OS?

Share this post


Link to post
Share on other sites

hi @flydev

I didn't follow the whole thread. Maybe you want to have a look at https://doc.nette.org/en/2.4/finder and https://doc.nette.org/en/2.4/filesystem; Maybe this makes things easier :)

You could also have a look at Soma's online installer: https://raw.githubusercontent.com/somatonic/PWOnlineInstaller/master/grabpw.php (this is in use for a long time and should be tested on all systems).

 

  • Like 1

Share this post


Link to post
Share on other sites

I'm getting the error below

Quote

Warning: filesize(): stat failed for /home/floriann/public_html/site/assets/logs/duplicator.txt in /home/floriann/public_html/wire/core/FileLog.php on line 225

Warning: filesize(): stat failed for /home/floriann/public_html/site/assets/logs/duplicator.txt in /home/floriann/public_html/wire/core/FileLog.php on line 225

Warning: filesize(): stat failed for /home/floriann/public_html/site/assets/logs/duplicator.txt in /home/floriann/public_html/wire/core/FileLog.php on line 237

Warning: file(/home/floriann/public_html/site/assets/logs/duplicator.txt): failed to open stream: No such file or directory in /home/floriann/public_html/wire/core/FileLog.php on line 238

The mention of filesize is odd because this site is a 1 page holding page with 4 medium images. Other than that it's the usual 3.0.96 files.

This is on a server which I don't have complete control over. Otherwise I'd get you better server info.

  • Like 1

Share this post


Link to post
Share on other sites

@Peter Knight   this issue is known and fixed in the next version.

The cause is that the ProcessModule try to load the log file but the file does not exist (the file is created on the first backup).

  • Like 3

Share this post


Link to post
Share on other sites
Posted (edited)

Hello,

the module got updated, please upgrade it to version 1.1.9.

This version contain some small fixes, the major fix is that packages can be built/extracted on Windows and/or Unix platforms and the exclusion feature still work as expected.

Apart from that, I am working on the GoogleDrive feature; It look like that the AmazonS3 feature need an update. Dropbox v2 planned for soon.

 

@adrian I found (another or maybe this is what you was talking about ?) confusing thing with GoogleDrive. Duplicator can store 10 packages in GoogleDrive and delete the older keeping the newer but without differencing packages built on distinct websites. In the current state of the module, when he get files from Google Drive, all packages are threated as "one (1) website".

 

Edited by flydev
Amazon still working
  • Like 2

Share this post


Link to post
Share on other sites
20 minutes ago, flydev said:

@adrian I found (another or maybe this is what you was talking about ?) confusing thing with GoogleDrive. Duplicator can store 10 packages in GoogleDrive and delete the older keeping the newer but without differencing packages built on distinct websites. In the current state of the module, when he get files from Google Drive, all packages are threated as "one (1) website".

Sorry @flydev - I don't quite follow what you are saying there, but to clarify what I am seeing - once it hit's 10 packages for one site, none are deleted, so no more are uploaded unless I manually delete some.

  • Like 1

Share this post


Link to post
Share on other sites

Sorry - ok understood, its another issue then. 

Thanks again.

  • Like 2

Share this post


Link to post
Share on other sites

For people interested, Dropbox support is back. It needs to be tested a bit ^_^

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
8 hours ago, flydev said:

Dropbox support is back. It needs to be tested a bit

Thanx a lot! I will check it out this week.

  • Like 1

Share this post


Link to post
Share on other sites

Cool! I forgot to say that the Dropbox API installation is only supported trough Composer. I will see if I got the time to make a "standalone SDK".

 

Also I don't know if people here already heard about of the cloud backup solution for professional, iDrive. Our company is a long time customer of their services and we never had an issue. They have military grade security implemented on backups. I was not going to promote their service as I trough they had only paid plans, but finally they have a free plan of 5Gb. I would like to say that there are no more reason to not have a professional backup solution for your client !

It will be implemented in Duplicator very soon as I need it quickly! 💪

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
45 minutes ago, flydev said:

Also I don't know if people here already heard about of the cloud backup solution for professional, iDrive.

 

Started using iDrive after CrashPlan announced the end of their Consumer plans. Not a bad product at all and they often have great discounts on the Macworld newsletters. 

I'm a bit of a backup junkie and have been through (or am still using)

  • Syncplicity
  • Sugar Sync
  • Crash Plan
  • DropBox
  • Google Drive
  • Amazon Backup Drive
  • Amazon S3 storage
  • oDrive
    and probably more

However realising this is a ridiculous setup I am going to consolidate soon :)

Just discovered a really nice app called pCloud recently and it works a little different. It creates a virtual cloud drive on your machine so that any files you put in there don't take up space on your local machine. Worth a look as the Apps and website based account ar every nicely done. As much as I like iDrive and others, some of the interfaces are awful. iDrive looks like something from the 90s.

  • Like 1

Share this post


Link to post
Share on other sites
57 minutes ago, flydev said:

but finally they have a free plan of 5Gb.

Sounds great! I think I will give it a test drive, however, I cannot find its features listed:

https://www.idrive.com/pricing

Do they mean that the Free plan is exactly the same as Personal except the difference in storage limit?

  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, Peter Knight said:

iDrive looks like something from the 90s.

I lol'd, thanks.

Yes sure, but its robust! Like ProcessWire and his 90s homepage 😅 They work on features, no time for frontend fashion things!

  • Like 2

Share this post


Link to post
Share on other sites
On 4/10/2018 at 9:51 AM, szabesz said:

Sounds great! I think I will give it a test drive, however, I cannot find its features listed:

https://www.idrive.com/pricing

Do they mean that the Free plan is exactly the same as Personal except the difference in storage limit?

If you're considering a paid plan, there's 90% off for the first year here

https://www.idrive.com/idrive/signup/el/macworld90

That's not my affiliate link but probably MacWorlds

  • Like 2

Share this post


Link to post
Share on other sites

Thanks Peter, however I never fall for "first year is cheaper" and such because after that period normally one has to pay the full price.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By John W.
      Question 1
      I recently installed PW 3.0.62 for a new site and also have sites running older version of PW 3.x.
      Can I export the database on an older version of PW 3.x and import it to PW 3.0.62 without any issues?
       
      Question 2
      (This is kind of alternative to the above for long term use - and maybe a better solution...)
      On  the sites I've previously built I have templates (home, basic-page, contact) and fields that I commonly use, such as business_name, phone_1.  The last site I built is running PW 3.0.42.  I was considering cloning this into a local site and running the upgrade module to bring it up to PW 3.0.62. From there on out when I start I new project I could just run the PW upgrade module, copy the folder to the location for the new project and duplicate the database using the new projects name.

      So basically, I'll always keep a "blank slate" site that I can just run the PW upgrade on, then duplicate into a new project. This would cut down on the work and time spent having to re-create these common fields, that I use. From there, I would just add fields, templates, etc, specific for the new website project.

      Is this a sound approach to speed up development?

       
    • By John W.
      I just posted a question about moving PW from a resting domain to a production domain, after consideration I figure I would create a new post for a second question I have.
      I noticed the coming feature of client size image resizing. This will be really helpful, as I have some clients on a Satellite connection. I'm telling you, them trying to upload 15MB images, or them getting them straight on batch resizers (or Photoshop) to resize before upload is a real chore. Needless to say, Ryan has been doing an excellent job addressing this.
      My question, is that I have several clients on PW 2.x thru 3.x. Is there a really good guide on steps that I need to take to update the core to take advantage of the features of new releases? Are their perils to look out for?
      Yeah, after developing several sites, I feel a bit silly about asking this one, but, the docs doesn't seem to be clear in a "general" sense of upgrading the core across all versions.
      Thanks everyone for your time and assistance.
    • By suntrop
      Hi all
      I have big troubles with my DB backups and phpMyAdmin. I can't manage to import a backup.
      The phpMyAdmin export settings are left to the defaults. The error message I get:
      #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `caches` (`name`, `data`, `expires`) VALUES ('ModulesUninstalled.in' at line 11 When I delete the complete 'cache' section there are almost for all tables the same errors. (part of the dump attached)
      I had this problem before and back then (couple months ago) I think I copied almost every table individually. I thought it was specific to that DB. But I can't do a dump/import of any of my PW installations.
      MySQL: 5.6.27
      PHP version: 7.0.11
      phpMyAdmin: 4.5.5.1
      Anybody knows that problem? Or what to do?
      phpMyAdmin SQL Dump.sql
    • By vwatson
      Is it possible to add check boxes in order to select multiple backup files and delete them all at once, rather than having to click each one, then Delete?
      Also it would be helpful to make the Restore process more distinct from Deleting.  I must have inadvertently clicked the wrong button once and restored a backup unintentionally, wiping out a day's work. My mistake of course. I obviously wasn't paying close enough attention.  
    • By Fantomas
      Hi all,
      I'm still new to processwire and now I have to create the first hook.
      I need to modify the page-clone module, so there is a field in pages that has to be empty after cloning the page. How could I start this task?