Jump to content

☁️ Duplicator: Backup and move sites


Recommended Posts

3 hours ago, rjgamer said:

Duplicator does not work with PHP 8 anymore. get_magic_quotes_gpc() is removed.

Is there any Roadmap to see how the module get evolved in the next few months?

Sorry, I don't have a PHP 8 install available at the moment. You are getting an error when using the installer, correct ?

Give me seconds.

Link to comment
Share on other sites

On 11/27/2020 at 6:01 PM, flydev 👊🏻 said:

@rjgamer 

Fix pushed, you can update the module from Github, master branch or wait that the modules directory update itself to update it from ProcessWire Upgrades (I can't login to do it manually).

Please let me know 👍🏼

 

Thank you! Could not test it yet. But wow, what a fast response. 👍

Link to comment
Share on other sites

  • 2 months later...

Is it possible to have the backup only run on certain hosts? I don't want it to backup my localhost to S3, just the production site.
Also - it would be ace if it would only backup on page saves. As 99% of the time my sites are static so a FE render doesn't matter. Hooking into page saves would be great. Though we'd ideally want to limit it as well =/

(Maybe debug mode is a good proxy for this, a tickbox for debugging in debug mode.)

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for this module.

I am on pw latest stable and the making of the package works fine

Then when I upload to new site and run the installer, all seems to work, files are created, database is created, and the homepage shows up, yet when I click on any link I get a 404, somehow things do not work

Any ideas?

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Since the last update of the Upgrades module, there are two packages of duplicator:

grafik.thumb.png.41c0290c50b0534778633d96e235a524.png

One can be upgraded, the other not. And when I install duplicator, only the module "Duplicator" got installed. I've had to install "ProcessDuplicator" manually. Thanks to this info here.

It's look like something smaller is messed up since the last few PW updates. Or not?

Link to comment
Share on other sites

  • 3 months later...

Hi all,

I took over an old system with

- debian 9.13 (stretch)

- php 5

- pw 3.0.123

And I tryed to use the installed duplicator. It did not work like I would expect it (on my personal machines it workes). So I installed php7 and the latest version (1.4) of duplicator. After that I get this messages (below) in the front end of the package manager page but in the info box (duplicator config page) I get Package(s) found ›  1  Package Manager. So the built file is there on the server but not displayed in the front end. And the file is just containing paths (shown below)

Quote

package build failed.
2021-07-29 15:42:55:  - an error occured during package build.
2021-07-29 15:42:55:  - an error occured while building the ProcessWire structure.

And in the backup directory there is a file 2021-07-29 ...zip.log with many paths in it, like

Quote

0.0s: DIR: /var/www/mywebsite

0.0s: ZIP /.htaccess-...

0.0s: ZIP /wire/config.php

...

Does anyone have a clue?

Link to comment
Share on other sites

  • 4 months later...

My Duplicator just stopped working.

I've been simply using the manual 'Backup Now' feature to create a package from my live site, upload it to the dev site and install to keep the dev site up to date. It's worked flawlessly until today. It has been longer than usual- about a month- since I did the last backup and sync, I've added a lot of new fields and a few new templates to the site since then. The database has grown from 11MB to 21MB.

The most recent log in /site/assets/backups looks nearly identical to the last successful one, both end with the same:

'0.6s CLOSING ZIP: (path)'

'Done in (7.x) seconds'

No mention of any errors. Nor was any Zip file actually created.

When I go to Modules > configure > Duplicator under 'info:' it says '12 packages found' but in the package manager it says 'No Packages Found'.

I looked at /assets/logs/duplicator.txt and there are the same 3 useless error messages others have reported.

-an error occured while building the ProcessWire structure:

-an error occured during package build

-package build failed.

So I uninstalled and deleted Duplicator, then re-downloaded, re-installed it, and tried once again to 'Backup Now'. It still fails.

Welp, guess that's that. 🤷 It was a nice module while it lasted...

Is there any way I could at least make it output a helpful error log that tells me what it was trying to do at the point it failed?

Link to comment
Share on other sites

  • 2 months later...
Posted (edited)

March 2022 UPDATE

The module got updated, the current stable version is the ^1.4.17

The module can be updated troughs ProcessUpgrade or from Github, all the updates and fixes made by @Autofahrn are now in the master, some minors fixes was also pushed.

The main feature of this update beside all the fixes is the native backup mode which use mysqldump if available and set in Duplicator options.

 

💡 I have not tested it personally on PHP-8 but @rjgamer made some update to fixes notices and warning.

- a test of a backup of 2GB was successfully created on 169 seconds

 

 

Edited by flydev 👊🏻
👉 Screencast of a backup with Duplicator v1.4.17 / was tested on php-8.x
  • Like 10
  • Thanks 1
Link to comment
Share on other sites

@rjgamer I check it.

Thanks you @adrian , the update also contain your change - feel free to ping me if something is broken.

 

---

@rjgamer I checked it on PHP-7.4, 8 and 8.1 and I don't get any error, the package is created after invoking cron.php

When you can please update to v1.4.18 and fill an issue if the problem persist 👍

 

  • Like 1
Link to comment
Share on other sites

Just installed this module on the DEV version. But my hosting didn’t like it:

Fatal Error: Uncaught Error: Call to undefined function disk_total_space() in site/modules/Duplicator/Duplicator.module:1135

#0 site/modules/Duplicator/Duplicator.module (1230): Duplicator::getLocalFolderInfo()
#1 [internal function]: Duplicator::getModuleConfigInputfields(Array)
#2 wire/core/Modules.php (4110): call_user_func(Array, Array)
#3 wire/core/Wire.php (420): Modules->___getModuleConfigInputfields('Duplicator', Object(InputfieldForm))
#4 wire/core/WireHooks.php (951): Wire->_callMethod('___getModuleCon...', Array)
#5 wire/core/Wire.php (485): WireHooks->runHooks(Object(Modules), 'getModuleConfig...', Array)
#6 wire/modules/Process/ProcessModule/ProcessModule.module (1665): Wire->__call('getModuleConfig...', Array)
#7 wire/modules/Process/ProcessModule/ProcessModule.module (1399): ProcessModule->renderEdit('Duplicator', Array)
#8 wire/core/Wire.php (414): ProcessModule->___executeEdit()
#9 wire/core/WireHooks.php (951): Wire->_callMethod('___executeEdit', Array)
#10 wire/core/Wire.php (485): WireHooks->runHooks(Object(ProcessModule), 'executeEdit', Array)
#11 wire/core/ProcessController.php (337): Wire->__call('executeEdit', Array)
#12 wire/core/Wire.php (414): ProcessController->___execute()
#13 wire/core/WireHooks.php (951): Wire->_callMethod('___execute', Array)
#14 wire/core/Wire.php (485): WireHooks->runHooks(Object(ProcessController), 'execute', Array)
#15 wire/core/admin.php (160): Wire->__call('execute', Array)
#16 wire/modules/AdminTheme/AdminThemeDefault/controller.php (13): require('/customers/a/0/...')
#17 site/templates/admin.php (15): require('/customers/a/0/...')
#18 wire/core/TemplateFile.php (327): require('/customers/a/0/...')
#19 wire/core/Wire.php (414): TemplateFile->___render()
#20 wire/core/WireHooks.php (951): Wire->_callMethod('___render', Array)
#21 wire/core/Wire.php (485): WireHooks->runHooks(Object(TemplateFile), 'render', Array)
#22 wire/modules/PageRender.module (575): Wire->__call('render', Array)
#23 wire/core/Wire.php (417): PageRender->___renderPage(Object(HookEvent))
#24 wire/core/WireHooks.php (951): Wire->_callMethod('___renderPage', Array)
#25 wire/core/Wire.php (485): WireHooks->runHooks(Object(PageRender), 'renderPage', Array)
#26 wire/core/WireHooks.php (1059): Wire->__call('renderPage', Array)
#27 wire/core/Wire.php (485): WireHooks->runHooks(Object(Page), 'render', Array)
#28 wire/modules/Process/ProcessPageView.module (184): Wire->__call('render', Array)
#29 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(Page), Object(PagesRequest))
#30 wire/core/Wire.php (417): ProcessPageView->___execute(true)
#31 wire/core/WireHooks.php (951): Wire->_callMethod('___execute', Array)
#32 wire/core/Wire.php (485): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array)
#33 index.php (55): Wire->__call('execute', Array)
#34 {main}
thrown (line 1135 of site/modules/Duplicator/Duplicator.module) 

This error message was shown because: you are logged in as a Superuser. Error has been logged.

 

  • Like 1
Link to comment
Share on other sites

@Claus this issue is quite strange as it's a core PHP function.  

 

Could you test to create a file test_disk.php containing the following code

<?php echo phpversion() . "  -  " . disk_total_space(__DIR__); ?> 

and navigate to this php page to check result ?

 

If you still have an issue, it could be that your host disabled this function on php.ini disabled_functions directive. On PHP-8  :

Quote

Disabled functions are now treated exactly like non-existent functions. Calling a disabled function will report it as unknown, and redefining a disabled function is now possible.

 

Which hosting provider are you using ?

Link to comment
Share on other sites

4 minutes ago, flydev 👊🏻 said:

@Claus this issue is quite strange as it's a core PHP function.  

 

Could you test to create a file test_disk.php containing the following code

<?php echo phpversion() . "  -  " . disk_total_space(__DIR__); ?> 

and navigate to this php page to check result ?

I don’t think I can(?) The server is my ‘production’ server, and is using the PW .htaccess to deny such things. If you have an idea on how to do it please let me know!

Link to comment
Share on other sites

2 minutes ago, Claus said:

If you have an idea on how to do it please let me know!

If you create this file on the root directory and navigate to https://mysite.xyz/test_disk.php it should work.

 

ps: Please re-read my edited post above.

Link to comment
Share on other sites

9 minutes ago, flydev 👊🏻 said:

If you create this file on the root directory and navigate to https://mysite.xyz/test_disk.php it should work.

 

ps: Please re-read my edited post above.

Alright, it worked, and it returns nothing. The hosting provider is One.com

I found a way to enable PHP debug in the One.com interface, and now I get:

Fatal error: Uncaught Error: Call to undefined function disk_total_space() in /customers/a/0/5/website.com/httpd.www/test_disk.php:1 Stack trace: #0 {main} thrown in /customers/a/0/5/website.com/httpd.www/test_disk.php on line 1

 

  • Like 1
Link to comment
Share on other sites

I have changed my PHP version from 7.x to 8.1. The changeover will take 10 mins, and I’ll report back if the output changes. (Please see my above post – I edited it.)

  • Like 1
Link to comment
Share on other sites

Aha / bingo from running <?php phpinfo(); ?> on PHP 8.0.16:

disable_functions	disk_total_space, diskfreespace, exec, system, popen, proc_open, proc_nice, shell_exec, passthru, dl

 

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