Jump to content
flydev 👊🏻

☁️ Duplicator: Backup and move sites

Recommended Posts

I just sent a PM.

Share this post


Link to post
Share on other sites

@arjen quickly seeked the log and do not found anything wrong. In that log closing happens at 0.5s and opening at 2.7s so everything seems to work fine a the time between close and open indicates the time for zip operations to take place. You may give it a try and place the backups in some other location (i.e. next to the .../public folder or in .../public/backup), but I doubt this helps, since the logfiles are there.

I can only guess that the $zip->close() fails for some reason, so please try changing that block to read:

		$zipLog->verbose("CLOSING ZIP: {$zipfile}");
		$res = $zip->close();
		if($res !== true)
			{
			$zipStatus = $zip->getStatusString();
			$zipLog->verbose("CLOSE ZIP FAILED: {$zipStatus} in {$zipfile}");
			throw new WireException("Unable to close ZIP ({$zipfile}): {$zipStatus}");
			}
		$zipLog->verbose("OPENING ZIP: {$zipfile}");

Since I expect the close to fail I've read the complete log and saw, that it tries to zip temporary files generated by ProCache. So its probably worth to add an exclude for ProCache:

%/ProCache-[^/]+$%  # Ignore ProCache directory

and maybe the pwpc directory as well:

/site/assets/pwpc/

Edit: forgot that exclusion directories must be site-relative (so its /site/assets/pwpc/  not /pwpc/)

  • Like 3

Share this post


Link to post
Share on other sites

@AutofahrnDanke for your hard work on this. I really appreciate it. 

I've excluded both pwpc and added the regex to the config. No luck. I then changed the "Absolute path of the directory where packages are saved." to the ../public folder. No luck either. Funny thing is though that the log says it still wants to save in the "default" folder. 

When I add your code I'm getting a "Parse error: syntax error, unexpected '$res' (T_VARIABLE)". I've double check the syntax, but it seems to be okay. Not sure what is going on there as well.

I also removed all filecompiler files and let it recompile again. No luck.

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, arjen said:

When I add your code I'm getting a "Parse error: syntax error, unexpected '$res' (T_VARIABLE)".

Did you check for bad characters? Had this sometimes with copy&paste code from the forum.

Modified the script a little to hopefully display a reasonable error message.

  • Like 1

Share this post


Link to post
Share on other sites
15 hours ago, Autofahrn said:

Did you check for bad characters? Had this sometimes with copy&paste code from the forum.

Due to the tooltip problem, the only safe way to copy anything from the forum is to quote the message and then copy from the message composing area.

  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites

Finally fixed @arjen's issue, culprit was a non-readable file within the pwpc directory which wasn't excluded since I forgot exclusion paths need to be site relative (/site/assets/pwpc/ for all ProCache users).

  • Like 4

Share this post


Link to post
Share on other sites
On 1/28/2017 at 2:34 PM, flydev said:

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

Hi flydev,

just needed to use this module and didn't find that button until i found that I need to install the process module. In one of your screencasts there was the "event trigger" dropdown which is not there any more in newer versions. Why is the process module not installed on installation? I was looking under "setup" before installing the process module and there was of course no duplicator page until i found out that I had to install the process module manually.

Maybe you could also add a hint on the duplicator config screen?

Thx for you module!

  • Like 1

Share this post


Link to post
Share on other sites

Hi @bernhard cool to see that you needed this module for your case.

About your question, I quote myself :

Quote

The Process module is not really required because Duplicator could be, if needed, only run from CRON task.

 

That's not the first time this question is asked, I will make the Process module installed automatically on the next version (which should be ready for the end of august).

  • Like 5

Share this post


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

That's not the first time this question is asked, I will make the Process module installed automatically on the next version (which should be ready for the end of august).

A hint on the module config page would also be fine 🙂 "Install Process Module" or "Process Module is (not) installed"

PS: Sorry, didn't follow this 14 pages thread closely enough 😉 

  • Like 2

Share this post


Link to post
Share on other sites
On 7/18/2019 at 1:43 PM, bernhard said:

A hint on the module config page would also be fine 🙂 "Install Process Module" or "Process Module is (not) installed"

PS: Sorry, didn't follow this 14 pages thread closely enough 😉 

Yep) There is a link to process module that is broken "by default" if the process module is not installed.
And I would guess most of the time users would expect an admin page to be in place after installation for such a module.
Maybe reconsider and make it auto installed?

  • Like 2

Share this post


Link to post
Share on other sites
3 hours ago, rjgamer said:

Does the duplicator also duplicate the database? If yes, how does it work?

Learning by doing. Could find it out by myself 🙂

But...

On 3/19/2019 at 7:58 AM, flydev said:

There is a work in progress on a development version (v1.3.10-ATO) - ...

What does ATO mean? Any plans for the next final release?

Share this post


Link to post
Share on other sites

Hey I use DUPLICATOR for backups.

In all of a sudden my cronjob don't work anymore.

I get the following error in Duplicator.module line 663:   

 PHP Warning: ZipArchive::Close(): Internal error

I use the cron.php file.

Has anyone an idea why this happens and what I can do?

Thanks in advance.

Marcel

  • Thanks 1

Share this post


Link to post
Share on other sites

Hey @flydev thanks for you reply!

1. PHP 5.6.38

2. Duplicator 1.2.9

3. Processwire 3.0.123 (dev, master)

 

EDIT: So far I cannot tell if it is a Duplicator issue or a server administration issue. I am not so familiar with server administration. Still learning this by doing this.

 

 

Share this post


Link to post
Share on other sites
On 9/30/2019 at 11:22 AM, Marcel said:

Hey @flydev thanks for you reply!

1. PHP 5.6.38

2. Duplicator 1.2.9

3. Processwire 3.0.123 (dev, master)

 

EDIT: So far I cannot tell if it is a Duplicator issue or a server administration issue. I am not so familiar with server administration. Still learning this by doing this.

 

 

PHP 5.6.38 ??
Are you serious?! 😉

Share this post


Link to post
Share on other sites

Hey @flydev just tried to backup an almost abandoned project of mine with your Duplicator module.

Installation (recent version from the modules directory via PW), setup and initial backup (local folder, no FTP or cloud) worked fine and I was curious about how the installer.php would work and gave it a try.

Then at some point it became weird.

2019-12-07_16-30.thumb.png.797b744883003bf088c3d1fe4349dbf9.png

The installer looked for config.php in a folder that does not exist at that point and path.

I repeated everything, moved the files around but there was no config.php anywhere in the backup. Neither the script created one.

Am I missing something here or ... changed something somewhere else that doesn't work well with your module?

I created a backup of an PW 3.0.132 instance. Both, remote and local, use PHP 7.2.x-

 

This question isn't urgent or anything!

 

  • Like 1

Share this post


Link to post
Share on other sites

Thank you @flydev. I somehow missed that road to 1.3.12-ATO but I just installed and tried it again.

Backup and reinstall runs buttery smooth. Perfect!

  • Like 1

Share this post


Link to post
Share on other sites

@flydev I installed Duplicator today (ATO version). Local backups work fine, but FTP does nothing.

In the log I just see:

Quote

2019-12-30 22:25:14:  - package build failed.
2019-12-30 22:25:14:  - package build failed,  doesn't exist

What exactly "doesn't exist"? I have entered /public_html/pwb in "upload directory". This folder definitely exists, and the FTP credentials are correct. Any pointers where to look? Do I have to enter server path without leading / ? Something else I missed?

  • Like 1

Share this post


Link to post
Share on other sites

@dragan: are you working on a shared server or do you indeed have a /public_html directory right at filesystem's root?

"absolute path" relates to filesystem not webroot, so you are free to locate the backup destination somewhere else.

It probably would be a good idea to support the regular home prefix, so path may be entered relative to webroot (something like "~/backup-folder"), at the moment you have to prefix the path with the location of your webroot.

  • Like 2

Share this post


Link to post
Share on other sites
31 minutes ago, Autofahrn said:

are you working on a shared server

Shared.

I tried absolute paths, and also tried ~, but so far without success.

  • Like 1

Share this post


Link to post
Share on other sites

~ syntax is not implemented yet. What absolute path did you use? Should equal whatever is stored in $config->paths->root to be located inside your webroot.

  • Like 2

Share this post


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

What absolute path did you use?

The absolute path of the remote destination server (where I want the backup to be stored via FTP).

11 hours ago, Autofahrn said:

Should equal whatever is stored in $config->paths->root to be located inside your webroot.

Why is that? PW is not even installed on the destination server. I am talking about the field "FTP Settings: Upload directory: Directory on the server where the packages will be stored." Why is that supposed to be the same as my local path "D:/laragon/www/pw/"? That makes no sense.

  • Like 2

Share this post


Link to post
Share on other sites

Sorry, I somehow missed the FTP part since already the package build seems to fail. And there should be the name of the zipfile in the "package build failed, <ZipNameExpectedHere> doesn't exist" message.

Seems to be a Windows system, guess there could be an issue with the backslash path separator.

Edit: The attached version 1.3.13 fixes the (false) package build error, supports custom package name and allows prefixing local path with ~/ to refer to webroot.

 

Duplicator-ATO1.3.13.zip

  • 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 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...