Jump to content
flydev 👊🏻

☁️ Duplicator: Backup and move sites

Recommended Posts

This might be a bit off topic, but this problem has come up a few times. Maybe the modules directory could proxy downloads of modules and add the vendor folder on demand (to the module itself) if a composer.json is present. So users can choose if they do a composer install some/module or install it via the backend – without the benefits of a global dependency management tool in the latter case.

  • Like 4

Share this post

Link to post
Share on other sites

How to create a GoogleDrive service account step-by-step

Edited the 2017-02-18


Go to https://console.developers.google.com


  • Create a new project:




  • Enable the API:





  • Create credentials:



  • Select "New service account"




  • Click on Create and save the JSON key file
  • Click on Manage service accounts :



  • Copy the service account ID :



  • Configure Duplicator by copy/pasting the service account's email and the content of the JSON key file :



  • Like 4

Share this post

Link to post
Share on other sites
9 hours ago, fbg13 said:

@flydev Take a look at https://github.com/jubos/fake-s3 and https://github.com/jserver/mock-s3

I have not used them.

It is mainly to test different servers configuration as currently the AmazonS3 implementation is quite stable. And I found a way directly in the AmazonAWS console to create accounts and sharing keys for users.

Anyway thanks for the suggestion, maybe I will give  a try by curiosity ;)

  • Like 1

Share this post

Link to post
Share on other sites

Just a small update:

I managed to get the module working without Composer. All SDKs can be downloaded separately and you can choose which one Cloud Service to use or even not use any at all.


And some precisions :

What is the primary goal of this module and how it works?

This module is a backup utility. It make a package which contain a full database dump + full website. The package can be saved locally or/and uploaded to a FTP server, GoogleDrive, Dropbox or AmazonAWS.


is it compatible with PW2? Guess not.

With 2.8 yes.  ProcessWire 2.7 need to be tested as now every SDKs can be downloaded separately. But it already works for saving package to a local folder.


I don't use composer. Any other way to install?

Just download the SDK you need.


I'm on windows. Will PWcron run?

Without any problem. Look at this answer to set up it: http://stackoverflow.com/questions/7195503/setting-up-a-cron-job-in-windows


What are google/dropbox/AWS needed for?

Only needed to upload a package to their service.


How can I restore the website? Is it possible to rebuild mine website on a other server?

Yes but you have to do it manually. You unzip the package (the zip file), upload your website, import you SQL database, adjust settings in config.php and tadaa, it works.

The final goal of the module is to automate this process, but is not yet implemented.




  • Like 5

Share this post

Link to post
Share on other sites

I prefer third party libraries to be included and managed via composer, but if you do include them in this module make sure to do it like this:


Notice the /*NoCompile*/ to prevent PW3's file compiler from compiling the third party libraries.

  • Like 1

Share this post

Link to post
Share on other sites
On 07/03/2017 at 6:38 PM, antpre said:


Looking forward to use this module.

Thanks for the work

Hi @antpre and everyone.  I lack time in recent days but the module should be available to the public the next coming week!

  • Like 4

Share this post

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

I lack time in recent days but the module should be available to the public the next coming week!

this is awesome news!

  • Like 1

Share this post

Link to post
Share on other sites

I feel really sorry. I have had some problems in recent months that have caused my brain to stop working .. And so I hesitated to launch the module knowing I could not give support.

Anyway, I'm better and I resume the development as soon as I have my internet connection operational (should be good for monday).


Sorry again guys!

  • Like 5

Share this post

Link to post
Share on other sites

Hi @flydev Nice to see you again. Looks like you are back on track. Any plans on working on this great module again? You have probably been waiting for this question ;)

  • Like 2

Share this post

Link to post
Share on other sites

And I was sure YOU will ask that ! :lol:O0


Sure, I am already trying to get back my Gitlab server. The server was hosted in a VMware guest machine, and when plugged the hdd and put the virtual machine ON, the network simply does not work anymore. Can't ping anything, but I know how to fix it, i am just too lazy those days. 

Edit: Just to say, I still have the code and used the module in the last days, but it look like its not the Windows compatible version..

  • Like 6

Share this post

Link to post
Share on other sites
On 07/03/2017 at 6:03 PM, gmclelland said:

Notice the /*NoCompile*/ to prevent PW3's file compiler from compiling the third party libraries.

I am checking for this, and it appear that all the SDKs are compiled despite using /*NoCompile*/ on the require_once.

Also I note that this feature was introduced in PW 3.0.43, so I assume the file will be compiled for PW 2.7. Concretely, what is the bad thing about leaving all those SDKs file being "FileCompiled" ?


	if($this->useFTP) {
            require_once(__DIR__ . '/Classes/FTPClient.php');

        if($this->useAmazonS3) {
            require_once (/*NoCompile*/ __DIR__ . '/SDKs/aws/aws-autoloader.php');
            require_once(__DIR__ . '/Classes/ClientAmazonS3.php');

        if($this->useDropbox) {
            require_once (/*NoCompile*/ __DIR__ . '/SDKs/dropbox/autoload.php');
            require_once(__DIR__ . '/Classes/ClientDropbox.php');

        if($this->useGoogleDrive) {
            //require_once __DIR__ . '/SDKs/google/autoload.php'; // oh my..
            require_once (/*NoCompile*/ __DIR__ . '/Classes/GoogleAutoload.pain.php');
            require_once(__DIR__ . '/Classes/ClientGoogleDrive.php');



Anyway, for the people who have the module in hand, I bumped the module to the version 0.0.36. The Gitlab server is not running up but will give a download link in PM as I would appreciate a test on a Windows machine..



Edited by flydev
server up
  • Like 3

Share this post

Link to post
Share on other sites

Hello guys !

The Gitlab server is fixed and running, you can update the module to the latest version. All SDKs can be downloaded separately without using composer, the link of each SDK is provided in the module settings.

You must uninstall the previous version before testing it.



  • Like 4

Share this post

Link to post
Share on other sites
On 8/12/2017 at 4:19 AM, flydev said:

Concretely, what is the bad thing about leaving all those SDKs file being "FileCompiled" ?

Here's the documentation on that http://processwire.com/blog/posts/processwire-3.0.43-core-updates/#new-filecompiler-options

Without the /*NoCompile*/ it would probably cause unneeded additional processing.  I think Processwire would also probably try to add namespaces to those third party libs which may cause random problems.

The code above looks correct, I'm not sure why it is still compiling.

  • Like 1

Share this post

Link to post
Share on other sites

Today,  there is a small a preview of a successful deployment (on localhost) using Duplicator :

  • Create a package in the backend
  • Download the package and the installer
  • Upload it to the new hosting
  • Navigate and run the installer




  • Like 5
  • Haha 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By David Karich
      ProcessWire InputfieldRepeaterMatrixDuplicate
      Thanks to the great ProModule "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use a content module on a different page (e.g. in the same design), you have to rebuild each item manually every time.
      This module extends the commercial ProModule "RepeaterMatrix" by the function to duplicate repeater items from one page to another page. The condition is that the target field is the same matrix field from which the item is duplicated. This module is currently understood as proof of concept. There are a few limitations that need to be considered. The intention of the module is that this functionality is integrated into the core of RepeaterMatrix and does not require an extra module.
      Check out the screencast
      What the module can do
      Duplicate a repeater item from one page to another No matter how complex the item is Full support for file and image fields Multilingual support Support of Min and Max settings Live synchronization of clipboard between multiple browser tabs. Copy an item and simply switch the browser tab to the target page and you will immediately see the past button Support of multiple RepeaterMatrix fields on one page Configurable which roles and fields are excluded Duplicated items are automatically pasted to the end of the target field and set to hidden status so that changes are not directly published Automatic clipboard update when other items are picked Automatically removes old clipboard data if it is not pasted within 6 hours Delete clipboard itself by clicking the selected item again Benefit: unbelievably fast workflow and content replication What the module can't do
      Before an item can be duplicated in its current version, the source page must be saved. This means that if you make changes to an item and copy this, the old saved state will be duplicated Dynamic loading is currently not possible. Means no AJAX. When pasting, the target page is saved completely No support for nested repeater items. Currently only first level items can be duplicated. Means a repeater field in a repeater field cannot be duplicated. Workaround: simply duplicate the parent item Dynamic reloading and adding of repeater items cannot be registered. Several interfaces and events from the core are missing. The initialization occurs only once after the page load event Changelog
      Bug fix: Various bug fixes and improvements in live synchronization Bug fix: Items are no longer inserted when the normal save button is clicked. Only when the past button is explicitly clicked Feature: Support of multiple repeater fields in one page Feature: Support of repeater Min/Max settings Feature: Configurable roles and fields Enhancement: Improved clipboard management Enhancement: Documentation improvement Enhancement: Corrected few typos #1 1.0.3
      Feature: Live synchronization Enhancement: Load the module only in the backend Enhancement: Documentation improvement 1.0.2
      Bug fix: Various bug fixes and improvements in JS functions Enhancement: Documentation improvement Enhancement: Corrected few typos 1.0.1
      Bug fix: Various bug fixes and improvements in the duplication process 1.0.0
      Initial release Support this module
      If this module is useful for you, I am very thankful for your small donation: Donate 5,- Euro (via PayPal – or an amount of your choice. Thank you!)
      Download this module
      > Github: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDuplicate
      > PW module directory: https://modules.processwire.com/modules/inputfield-repeater-matrix-duplicate/
    • By jaro
      This module (github) does with site/assets/files what Ryan's DatabaseBackups module does with the database:
      Backup site/assets Download ZIP archive Upload ZIP archive Restore site/assets Motivation: This module can be the missing part for projects with content backup responsibility on the client's side: The client will be able to download DB and assets/files snapshots through the backend without filesystem access, thus backing up all content themselves.
      Release state alpha – do not use in production environments.
      Credits for the nice UI go to @ryan – I reused most of it and some other code from the DatabaseBackups module.
    • By NorbertH
      Is there a hook to do something right after cloning a page ?
      I want the page to be saved right after cloning it either from the button in the tree or from a lister, because saving the page triggers several calculations that are not triggered by just cloning the page.
      Thanks in advance !
    • 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?

  • Create New...