Jump to content
flydev 👊🏻

☁️ Duplicator: Backup and move sites

Recommended Posts

Hello, thanks @Autofahrn that solved the problem but I still have an issue and I think it depends on the fact I'm running on a windows server with IIS (I reverted to php 7.3.13). While a fresh install of the latest PW is going well, the install from duplicator doesn't, I'm stuck in the extraction of the package, it looks like the $_SESSION['package'] returns null at this point but right after the extraction the session was ok, in fact I saw the name of the package in the previous step. Any thoughts?
 

$this->package = $_SESSION['package'];
        if(is_null($this->package)) {
            $this->err("Something went wrong in the installer.");    //ATO: Typo
            return false;
        }

 

Schermata 2020-04-02 alle 09.33.13.jpg

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi @Sevarf2

Can you make a screenshot of the Step #1 et #2 please ?

And FYI I also used the Duplicator installer on IIS without issue.

  • Like 1

Share this post


Link to post
Share on other sites

meanwhile I contacted the sys admin and it looks like there is some server misconfiguration we can't fix yet, when I upload the zip I found out that I cannot rename it, probably that's why the installer is stuck...but I was able to install a fresh PW..btw right now i can't show you the steps since we deleted everything and making tests

  • Like 1

Share this post


Link to post
Share on other sites

Okay - then if you have some feedback from the sys admin, let us know if possible, thanks 👍

  • Like 1

Share this post


Link to post
Share on other sites

Hi @flydev 👊🏻,

A feature request...

It would be awesome if there was a feature to enter a selector string that determined the pages whose files will be included in the backup. So that if the selector string was "template=basic-page" then in the backup the only directories inside /site/assets/files/ would be those belonging to a basic-page.

My use case is that I sometimes need to copy a site to my local machine to do some work, but that work only involves one part of the site. My connection speed is not great where I live (particularly upload speed) so it would be a big help if I only needed to download/upload the related files and not all the site files.

Thanks for considering. 🙂

  • Thanks 1

Share this post


Link to post
Share on other sites
17 hours ago, Robin S said:

My use case is that I sometimes need to copy a site to my local machine to do some work, but that work only involves one part of the site. My connection speed is not great where I live (particularly upload speed) so it would be a big help if I only needed to download/upload the related files and not all the site files.

Have you ever tried on-demand downloading of files? https://processwire.com/blog/posts/pw-3.0.137/#on-demand-mirroring-of-remote-web-server-files-to-your-dev-environment

This works really great. You can start with a completely empty files folder and PW will download all requested files on demand - either on the frontend or on the backend.

  • Like 2

Share this post


Link to post
Share on other sites
11 hours ago, bernhard said:

Have you ever tried on-demand downloading of files?

Thanks for the reminder - I just tried this for the first time and it works well. 

I still think it would be a nice feature to add to Duplicator because it's more efficient time-wise to download all the images you need in one hit while you have a coffee rather than page by page as you edit. Plus I reckon people will find other use cases for selectively including page files in a backup.

  • Like 1

Share this post


Link to post
Share on other sites
On 4/15/2020 at 2:40 AM, Robin S said:

My use case is that I sometimes need to copy a site to my local machine to do some work, but that work only involves one part of the site. My connection speed is not great where I live (particularly upload speed) so it would be a big help if I only needed to download/upload the related files and not all the site files.

Thanks for considering. 🙂

Considered @Robin S

I also have a bad connection (working with a 4G router) and it's definitely a good feature request. I will try to implement it asap, but I would like to release first the module with the native backup feature but I lack time. I will try to do my best.

 

Thanks for the link @bernhard

Thanks again guys, I hope you're all fine here 👊🏼

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for a fantastic module.

Would it be possible to exclude the database from the backup?

I ask because it get a timeout when running the backup, and I can move the database (which is quite large) by other means.

 

  • Like 2

Share this post


Link to post
Share on other sites

@eydun - two things.

1) Did you check the "Native" option in the module settings? I am sure you did, but just checking 🙂

2) Try the attached file in the Classes directory. I had to modify it to get it working at my end.

BackupDatabase.php

  • Like 1

Share this post


Link to post
Share on other sites

It does not work for me, so I will just take a manual backup of the files.

Thanks for the help 🙂

  • Like 1

Share this post


Link to post
Share on other sites

I plan to use this module as duplicater.

How is it handling database name?

I want to create a template PW site and clone it for new projects.

So i need to change the database name for every new clone. It should not overwrite former clones databases on the same server.

Can achive this with this module?

  • Like 1

Share this post


Link to post
Share on other sites

Yes, you enter database information when you restore the backup (try it).

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
On 4/16/2020 at 12:00 PM, eydun said:

Thank you for a fantastic module.

Would it be possible to exclude the database from the backup?

I ask because it get a timeout when running the backup, and I can move the database (which is quite large) by other means.

 

Hi @eydun

I can definitely give an option to exclude the database dump (> in the todo list) . Anyway, can we know the details and type of the hosting server ?

On my side, I can backup a ~4GB database, but it's a windows server that I configured myself (still on Apache).

 

@huseyin any news ? could you achieve what you was looking for by choosing the database name in the installer ?

Share this post


Link to post
Share on other sites
Quote

I can definitely give an option to exclude the database dump (> in the todo list) . Anyway, can we know the details and type of the hosting server ?

Hi @flydev 👊🏻 It would be cool to be able to backup the site and files because of the nice zip-functionality and installer in Duplicator, without backing up the database. I was on a shared Linux host. I guess the timeout limit was set too low. Anyway now I am on a much better host (Linode). 

  • Thanks 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 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
      1.0.4
      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 !
×
×
  • Create New...