Jump to content

☁️ Duplicator: Backup and move sites


Recommended Posts

Duplicator-logo-v2-Dlong.thumb.png.8898ec8cda79046779b10d8527fc0def.png

 

  • Last update: August 2022
  • Current stable version: 1.4.23
  • Dev version: 1.4.24

 

You can find the module on Github and in the modules directory :

 

Quote

To restore a website, just upload the package and the installer, then go to yourwebsite.com/installer.php then follow the instructions.

PLEASE, do not forget - after the end of the process - to delete the installer.php file and your package 

 

Screenshots / Features

  • Dir and files exclusion

dup2-feat-exclude.thumb.png.066de2c6ea27ae20db8abad2e91fa6a0.png

 

  • CRON job

dup3-feat-cron.thumb.png.060aff48a1cdd05d9687eca51f3cab4b.png

 

  • Advanced settings 

dup4-feat-adv.thumb.png.9f5d8726392ad5a63e0aa1e42347a545.png

 

  • Local and Cloud storage

dup5-feat-storage.thumb.png.35aa9c87454f472c2d04609988a42b44.png

 

 

Edited by flydev 👊🏻
Release of the v1.4.23
  • Like 22
  • Thanks 1
Link to comment
Share on other sites

Hey flydev,

Looks great. How far have you developed this?

The other module is at the very least beta software. I've got it running on several websites and it is running quite fast and smoothly. On the other hand I think there could be improvements. Perhaps you could join forces? Your modules both have the same goal. If you need help, I'm happy to help in any way.

  • Like 4
Link to comment
Share on other sites

58 minutes ago, arjen said:

If you need help, I'm happy to help in any way.

+1 :) Since @rot does not seem to have enough time to work on his module (he can correct me anytime... ;) ), I think it is quite reasonable for you to finish and maintain this module of yours. I would also be happy to use it, and share my findings about how it performs, etc.. meaning "testing it". 

  • Like 4
Link to comment
Share on other sites

It's weird, I was also about to start on something very similar, but also just recently noticed @rot's module, and now yours. @rot has been quiet here for a couple of months, so it would be good if he could confirm his intentions with updating his module. If you are close to being functional, it would be great to test both to figure out the differences in feature set.

  • Like 4
Link to comment
Share on other sites

Currently the module is functional, I use it on every site and it work quite well, no error since November.  At this moment only ProcessWire >3.0.0 is supported but I was planning to release it being compatible with 2.7.

 

What you can do with the module (working features) :

  • You can modify package's settings :  name of final filename, ignore some folders, set a maximum number of packages, remove older packages and trigger the backup function with LazyCron or PwCron.
  • Save the package in a local folder
  • Upload package to Dropbox
  • Upload package to GoogleDrive
  • Remove packages from those cloud services (depending on the configuration set)

*A package is a ZIP file bundled with a database dump and a full website directory dump (site, wire, etc)

 

I think I will finish the first public version and we'll see what happens as I tested the @arjen's fork of @rot's module and didn't managed to get it working as expected. I also find my module more "simple" to use; I mean you set options, check some checkbox, set a cronjob, click submit and let it run.

Also I saw some good features like emailing the logs on failure that could be added easily. I'll look at the module a little closer this afternoon.

 

Thanks for your input guys.

  • Like 8
Link to comment
Share on other sites

Thanks for sharing the preview! A few questions:

  • Will it be possible to do a manual backup without changing the module's Event trigger? It is not practical to change it back-and-forth just to do it manually once in a while. Or am I missing something?
  • Is a timestamp like this possible: 2017-01-28_13-55-17 (year-month-day-hour-minute-second)? This can be alphabetically sorted so we also get the order arranged chronologically at the same time.
  • Are you planning to implement any sort of "installer functionality" to simplify deployment/restore from the packages a little bit?
  • Like 2
Link to comment
Share on other sites

5 minutes ago, szabesz said:

Will it be possible to do a manual backup without changing the module's Event trigger? It is not practical to change it back-and-forth just to do it manually once in a while. Or am I missing something?

Good point. How about a simple button "Backup Now" to do it ?

 

8 minutes ago, szabesz said:

Is a timestamp like this possible: 2017-01-28_13-55-17 (year-month-day-hour-minute-second)? This can be alphabetically sorted so we also get the order arranged chronologically at the same time.

This is a thing in which I have to brainstorm; But definitely yes. I am looking for a good solution to name the packages files. Thanks here.

 

16 minutes ago, szabesz said:

Are you planning to implement any sort of "installer functionality" to simplify deployment/restore from the packages a little bit?

It was stipulated on my first post, this will be the best part of the module :) 

This one is the hardest part to implement in my point of view so it will come in a second time but ASAP! What I mean by ASAP - I will finish to implement Amazon upload  and the s/FTP as this last feature is required to jump to the installer one.

  • Like 4
Link to comment
Share on other sites

  • "How about a simple button "Backup Now" to do it ?" - Sure :)
  • "I am looking for a good solution to name the packages files." - Normally I name them like this: 2017-01-28_13-55-17-anything-i-find-descriptive.zip

Since you dubbed the module "Duplicator" you also implied that it will also be able to help in installing so I just wanted to make sure I got that right.

Thanks again for the awesome work!

  • Like 3
Link to comment
Share on other sites

This is going to be amazing! - here is a wishlist.., not sure if these can be gradually implemented..

- backup from scheduled cron job
- exclude by file extension, for example exclude all .mp3, or .jpg etc;  /alternately if the above is not possible, then the existing functionality of excluding directory would be ok (like exclude the site/assets/files in case that folder is multiple GB; we often just sync that folder with an S3 directory to keep a backup)...
- protect access to the module screen by role/user

  • Like 5
Link to comment
Share on other sites

9 hours ago, Macrura said:

- backup from scheduled cron job

This is already implemented as far as I can see in the preview gif. The module requires PwCron and in the Event trigger dropdown there are time intervals to choose from. This is where an "OnSubmit" option is also included, but that one needs to be turned into a standalone button. @flydev That reminds me that you will probably need to handle the situation when a scheduled cron job will try to run while a manual backup is running (and vice versa...) I guess it is not a good idea to let both run at the same time.

Edit: but I might be mistaken about the two jobs running parallel being a problem... I was just guessing here.

Edited by szabesz
  • Like 3
Link to comment
Share on other sites

As @szabesz already spotted it, scheduled cron job is already implemented using PwCron. About the Event-trigger dropdown, its meant to work with LazyCron but I had in mind to give a try to interact with PwCron directly from the interface of Duplicator.

For the situation where a package will be built manually at the same time as a scheduled cron job, there is a File Locking technique implemented, so it should not be an issue.

 

On 29/01/2017 at 0:08 AM, Macrura said:

- exclude by file extension, for example exclude all .mp3, or .jpg etc;  /alternately if the above is not possible, then the existing functionality of excluding directory would be ok (like exclude the site/assets/files in case that folder is multiple GB; we often just sync that folder with an S3 directory to keep a backup)...

It should not be a problem - In the todo list !  Thanks you !

 

On 29/01/2017 at 0:08 AM, Macrura said:

- protect access to the module screen by role/user

Any clue how I could start that ?

 

22 hours ago, szabesz said:

This is where an "OnSubmit" option is also included, but that one needs to be turned into a standalone button.

duplicator-preview.gif

 

 

  • Like 2
Link to comment
Share on other sites

24 minutes ago, flydev said:

Any clue how I could start that ?

Something like the below in your module's init() method. You can of course change it to  lookup a role or roles or some user IDs [if(!in_array()...].

public function init() {	
	if ($this->permissions->get('duplicator')->id && !$this->user->hasPermission('duplicator'))
		 throw new WirePermissionException($this->_('Duplicator: You have no permission to use this module.'));
}

 

  • Like 2
Link to comment
Share on other sites

1 hour ago, flydev said:
On 29/01/2017 at 0:08 PM, Macrura said:

- protect access to the module screen by role/user

Any clue how I could start that ?

If the module is a Process module you can create and require a custom permission in the module info (that is, getModuleInfo(), etc).

See the ProcessHello module for an example: https://github.com/ryancramerdesign/ProcessHello/blob/9c1aa18eb40d069c7fb227f09badddc90f0b3276/ProcessHello.info.php#L33-L39

  • Like 2
Link to comment
Share on other sites

A small news for this morning, the AmazonS3 feature is implemented on the module (its a pain when you don't know about a SDK).

Also please check the name of the final package as it was suggested by @szabesz.  Thanks again for the suggestion, its better and easily manageable.

 

Edit:

For information, all SDKs are installed via composer. Is it a problem for you ?

 

duplicator-preview.gif

 

 

 

Edited by flydev
infos
  • Like 6
  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, arjen said:

Will this work together with ProcessWireUpgrade?

+1 Experienced developers should not have problem learning the basics of Composer, however, using the ProcessWireUpgrade module is easier and even site owners can use it out of the box, so generally I prefer relying on it instead of Composer. This is a module that should support ProcessWireUpgrade as well, I think.

  • Like 5
Link to comment
Share on other sites

Mmm the module itself will be, but updating the SDKs with ProcessWireUpgrade (if that what you mean) will be hard if I am not missing something with this module.

What I am thinking after some tests, and in particular about shared hosting,  its to put on Github the vendor directory and let the user download and upload it to the their server if they want to use third party service storage. This approach only work (as the module itself) for ProcessWire 2.8 and 3.x. And if some people want simplicity on their virtual/private server, they just have to run a simple command line - composer update - in the root directory. Really, composer is nothing more than a tool to manage dependencies, and installing/using it require only one command line or a simple exe setup on Windows.

Anyway, I will try to find a compromise and/or to figure how to manage theses dependencies in the module directory itself. If I can manage this, the module will be compatible with ProcessWire 2.7.

  • Like 4
Link to comment
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
×
×
  • Create New...