Jump to content

☁️ Duplicator: Backup and move sites


flydev

Recommended Posts

Awesome, thank you! I am getting ‘Error reported by web service: That module is not currently tracked by the modules directory’ when I try to update the status in ‘processwire/module/edit?name=ProcessDuplicator’

I was not in the correct module… sorry.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

One of my websites using Processwire 3.0.184 and Duplicator 1.4.19. It was creating backups till 6 months back. I tried again today and although it starts the process it cannot complete it. It does not throw any error or display any message, just stops. The incomplete zip filw can be seen in the /site/assets/backups directory with a name like 2022-03-22_18-57-17-websitename.com.package2.zip.DOmR6A.

Any idea what could be going wrong?

Link to comment
Share on other sites

@kalimati could you please give me more information by checking :

  1. generated log if it exist located in `site/assets/backups`
  2. ProcessWire error log
  3. PHP(-fpm) error log

then reported back here please. Thanks.

 

Edit: 

  • Are you aware of an eventual hosting provider upgrade ?
  • Did the website and/or database as grow since last backup ?
Link to comment
Share on other sites

Thanks for your response, flydev.

Here are the three error logs but I don't see any clue in it.

Duplicator Logs

Quote

22 hours ago
2022-03-22 18:57:05     kalimati-jfitch     setup/duplicator/?action=backup_now     - Backup using standard mode
22 hours ago
2022-03-22 18:57:05     kalimati-jfitch     setup/duplicator/?action=backup_now     Backup Database
6 months ago
2021-10-04 20:19:03     kalimati-jfitch     setup/duplicator/?action=backup_now     - job finished in 51.702124sec
6 months ago
2021-10-04 20:19:03     kalimati-jfitch     setup/duplicator/?action=backup_now     - package saved in local folder: 2021-10-04_20-18-18-machinerylubricationindia.com.package2.zip
6 months ago
2021-10-04 20:19:03     kalimati-jfitch     setup/duplicator/?action=backup_now     - package built successfully in 51.701014sec

Processwire error log

Quote

4 days ago
2022-03-20 03:43:51     guest     /blog/think-affordable-artificial-blast/     Fatal Error: Uncaught Error: Call to undefined function displayAds() in /site/templates/_main.php:79 Stack trace:
1. /wire/core/TemplateFile.php(330): require()
2. /wire/core/Wire.php(394): TemplateFile->___render()
3. /wire/core/WireHooks.php(823): Wire->_callMethod('___render', Array)
4. /wire/core/Wire.php(465): WireHooks->runHooks(Object(TemplateFile), 'render', Array)
5. /wire/modules/PageRender.module(536): Wire->__call('render', Array)
6. /wire/core/Wire.php(397): PageRender->___renderPage(Object(HookEvent))
7. /wire/core/WireHooks.php(823): Wire->_callMethod('___renderPage', Array)
8. /wire/core/Wire.php(465): WireHooks->runHooks(Object(PageRende
Line 79 of /site/templates/_main.php
4 days ago
2022-03-20 03:43:43     guest     /blog/phase-data-extended-transaction/     Fatal Error: Uncaught Error: Call to undefined function displayAds() in /site/templates/_main.php:79 Stack trace:
1. /wire/core/TemplateFile.php(330): require()
2. /wire/core/Wire.php(394): TemplateFile->___render()
3. /wire/core/WireHooks.php(823): Wire->_callMethod('___render', Array)
4. /wire/core/Wire.php(465): WireHooks->runHooks(Object(TemplateFile), 'render', Array)
5. /wire/modules/PageRender.module(536): Wire->__call('render', Array)
6. /wire/core/Wire.php(397): PageRender->___renderPage(Object(HookEvent))
7. /wire/core/WireHooks.php(823): Wire->_callMethod('___renderPage', Array)
8. /wire/core/Wire.php(465): WireHooks->runHooks(Object(PageRende
Line 79 of /site/templates/_main.php

PHP Error log

Quote

 

[29-Dec-2020 20:44:00 Asia/Kolkata] PHP Fatal error:  Exception: SQLSTATE[HY000] [1045] Access denied for user 'pw_mli'@'localhost' (using password: YES) (in /home2/machinm3/public_html/mli2/wire/core/ProcessWire.php line 494)

#0 /home2/machinm3/public_html/mli2/wire/core/ProcessWire.php(302): ProcessWire\ProcessWire->load(Object(ProcessWire\Config))
#1 /home2/machinm3/public_html/mli2/index.php(52): ProcessWire\ProcessWire->__construct(Object(ProcessWire\Config))
#2 {main} in /home2/machinm3/public_html/mli2/index.php on line 64
[29-Dec-2020 20:44:00 Asia/Kolkata] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home2/machinm3/public_html/mli2/index.php:64) in /home2/machinm3/public_html/mli2/wire/core/WireShutdown.php on line 306
[29-Dec-2020 20:44:52 Asia/Kolkata] PHP Fatal error:  Exception: SQLSTATE[HY000] [1045] Access denied for user 'pw_mli2'@'localhost' (using password: YES) (in /home2/machinm3/public_html/mli2/wire/core/ProcessWire.php line 494)

 

I am not aware of any eventual hosting provider upgrade.

Yes the database has grown since last backup.

Link to comment
Share on other sites

Mmh from what I read, the issue doesn't appear to come from Duplicator but from an issue in /site/templates/_main.php line 79 on the call of displayAds which doesn't exist in Duplicator.

 

  • Like 1
Link to comment
Share on other sites

Thanks, that was it.

Actually that was being generated on sample pages (hidden) from a profile that I had left in the tree. displayAds was not supposed to function there. I trashed the pages and Duplicator worked.

But curious as to how a code on a template should affect Duplicator.

 

Link to comment
Share on other sites

3 hours ago, kalimati said:

But curious as to how a code on a template should affect Duplicator.

This is because Duplicator, as ProcessWire module, rely on ProcessWire code and thus, the PHP interpreter.

Then after saying that, you will remember that in PHP you have basically four (4) errors - notice, warning, parse and fatal error, and you will also remember that a notice give you a hint generally for an undefined variable but do not stop the code, the second tell you that you will end up scratching your head in the future but again do not stop the code. The third tell you that PHP can't parse the code and logically stop the code, as well as the last - the same as you got in - clearly say that the error is fatal and stop the code. At this point, your whole app is broken.

If we were using an external tool to make the package/backup, we would not encounter any error. This is the main answer of your question. Hope it help ??

 

Link to comment
Share on other sites

  • 5 months later...

?

An issue was reported on github about the FTP functionality which was not working on PHP-8.1, which is fixed in the dev branch (Duplicator v1.4.24).

369283957_190026417-dcf6ed54-9f3a-4118-94f1-5d4904b4d5691.png.279f3bbb1ed919452d4fa1f71b61d3f8.png

As I didn't tested to backup a thing on GoogleDrive and Amazon S3, if you spot other issues, please feel free to report it in this same thread or fill a github issue. It might also be the time to implement something related to GDPR (package encryption) which I think was already discussed somewhere. Thanks you.

Link to comment
Share on other sites

  • 3 weeks later...

Another update (v1.4.25) with a new setting available to customize the permission set on duplicator.sh when using the Native Mode feature. Thanks @netcarver

1121235742_Screenshot2022-10-01234635.thumb.png.c36504a731f4519c64ebf1caab419451.png

It also delete the corresponding log file.

 

ℹ️ The module can be upgraded again trough ProcessWireUpgrade, I was only updating a static var forgetting the module version field and then the module version was not reflected in the modules directory.. ?‍♂️

  • Like 3
Link to comment
Share on other sites

After reading again Steve's messages, I added a new setting (enabled by default) which if set, delete orphaned logs files from the folder.

Update to v1.4.26 to get that.

53499809_Screenshot2022-10-02125151.thumb.png.ead32548022041dedeaedbbf30979a07.png

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
On 9/13/2022 at 11:29 PM, flydev said:

As I didn't tested to backup a thing on GoogleDrive and Amazon S3, if you spot other issues, please feel free to report it in this same thread or fill a github issue. 

 

I am getting an error of 'Class "DUP_Logs" not found' when upgrading to the latest version (1.4.26) when using the Amazon S3 option.  The provided SDK is on place, all was working fine before the upgrade.  Reverting back to 1.4.0 solved the problem.  Here is the full call stack for reference:

538610422_ScreenShot2022-11-21at11_32_43AM.thumb.png.ba1da32fcf19ce5f2e0a9398015998e4.png

 

Thanks for a great module!

EDIT: I should note that the site is on PHP 8 and the latest stable version of PW

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

@protro thanks 👍

If you have already your site content, you have two simple solutions:

A. Using Duplicator:

  1. build a package
  2. remove all files and folders from the package2.zip and keep only the .sql.zip inside
  3. upload the installer.php file and the modified package2.zip on the root directory
  4. navigate to https://yoursite.com/installer.php and follow the instructions

The modified package2.zip file content 👇

image.png.804c0f229592392592744f7addef4974.png

 

B. Using ProcessDatabaseBackups

  1. install the module
  2. upload or select a db file
  3. restore it

⚠️ As always, make a backup of everything before proceeding

 

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